Struct nodes::storage::Storage
[−]
[src]
pub struct Storage<'a> { /* fields omitted */ }
Methods
impl<'a> Storage<'a>
[src]
fn load(
config: &'a Config,
name: &str,
path: PathBuf
) -> Result<Storage<'a>, LoadStorageError>
[src]
config: &'a Config,
name: &str,
path: PathBuf
) -> Result<Storage<'a>, LoadStorageError>
Loads the storage for the given stoage path. Note that the passed path has to be the base path of the storage, not the storage file itself.
fn next_id(&self) -> u64
[src]
Returns the next id that would be used for a node. Does not automatically increase it, see use_id.
fn use_id(&mut self)
[src]
Uses the current next_id, i.e. increases the id counter.
fn path(&self) -> &PathBuf
[src]
Returns the path of this storage
fn nodes_path(&self) -> PathBuf
[src]
Returns the nodes path
fn config(&self) -> &Config
[src]
Returns the associated config
fn name(&self) -> &str
[src]
Returns the name of this storage
fn nodes(&self) -> Vec<Node>
[src]
Returns a list of all nodes in this storage.
fn next_node(&self) -> Node
[src]
Trait Implementations
impl<'a> Drop for Storage<'a>
[src]
RAII drop implementation to save the storages state.