Module storage

Expand description

Interface and methods to store and load simulation aspects.

§Overview

In general, the storage solutions used can be configured with the StorageBuilder struct. Head there to view a list of all supported options.

use cellular_raza_core::storage::*;
let builder = StorageBuilder::new()
    .priority([StorageOption::SerdeJson])
    .location("/tmp")
    .add_date(true)
    .suffix("my_awesome_sim");

Afterwards, we can provide this builder to our chosen backend which will take the information contained in it and then construct a StorageManager to actually handle loading and storing.

§Storage Solutions

We provide multiple storage options to choose from.

§Json

Relies on the serde_json crate to serialize elements and store them as plain .json files. See JsonStorageInterface.

§Sled

Builds an embedded database at the specified location. This database is a key-value storage and can be accessed via the sled crate. See SledStorageInterface

§Sled (Temp)

Identical to the previous item but will remove the database after it has dropped. This options is mostly required when performing analysis steps afterwards without saving the full simulation results. See SledStorageInterface

Structs§

BatchSaveFormat
Define how batches of elements and identifiers are saved when being serialized.
CombinedSaveFormat
Define how elements and identifiers are saved when being serialized together.
JsonStorageInterface
Save elements as json files with serde_json.
MemoryStorageInterface
Use the [sled] database to save results to an embedded database.
RonStorageInterface
Save elements as ron files with ron.
SledStorageInterface
Use the [sled] database to save results to an embedded database.
StorageBuilder
Used to construct a StorageManager
StorageManager
This manager handles if multiple storage options have been specified It can load resources from one storage aspect and will

Enums§

StorageError
Error related to storing and reading elements
StorageMode
The mode in which to generate paths and store results.
StorageOption
Define how to store results of the simulation.

Traits§

FileBasedStorage
Abstraction and simplification of many file-based storage solutions
StorageInterface
Provide methods to initialize, store and load single and multiple elements at iterations.
StorageInterfaceLoad
Handles loading of elements
StorageInterfaceOpen
Open or create a new instance of the Storage controller.
StorageInterfaceStore
Handles storing of elements