aboutsummaryrefslogtreecommitdiff
path: root/src/baas.rs
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2021-11-09 02:08:20 +0100
committerDaniel Schadt <kingdread@gmx.de>2021-11-09 02:08:20 +0100
commit919796ec954414ae16f113896bdf212381c96437 (patch)
treecf08d8d2a06224bc22e1039985f3a37022938f2a /src/baas.rs
parent117f760d7cb389ef9bed5a206cf6a510a1225a1b (diff)
downloadmodderbaas-919796ec954414ae16f113896bdf212381c96437.tar.gz
modderbaas-919796ec954414ae16f113896bdf212381c96437.tar.bz2
modderbaas-919796ec954414ae16f113896bdf212381c96437.zip
more documentation
Diffstat (limited to 'src/baas.rs')
-rw-r--r--src/baas.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/baas.rs b/src/baas.rs
index 36a7aad..938b4c4 100644
--- a/src/baas.rs
+++ b/src/baas.rs
@@ -1,4 +1,4 @@
-//! Functions to manipulate the global Minetest installation.
+//! This module contains functions to query & manipulate the global Minetest installation.
use std::{collections::HashMap, path::PathBuf};
use dirs;
@@ -191,7 +191,8 @@ impl Baas {
/// Snapshot of a [`Baas`] scan.
///
-/// Every item is indexed by its ID/name.
+/// A snapshot is created through the [`Baas::snapshot`] method and gives a frozen view on the
+/// installed objects.
#[derive(Debug, Clone)]
pub struct Snapshot {
worlds: HashMap<String, World>,
@@ -200,14 +201,23 @@ pub struct Snapshot {
}
impl Snapshot {
+ /// Return all worlds that were found.
+ ///
+ /// The map maps the world's name to the [`World`] object.
pub fn worlds(&self) -> &HashMap<String, World> {
&self.worlds
}
+ /// Return all games that were found.
+ ///
+ /// The map maps the game ID to the [`Game`] object.
pub fn games(&self) -> &HashMap<String, Game> {
&self.games
}
+ /// Return the available mods that were found.
+ ///
+ /// The map maps the mod name to the [`MineMod`] object.
pub fn mods(&self) -> &HashMap<String, MineMod> {
&self.mods
}