cellular_raza_core/storage/
mod.rs

1//! Interface and methods to store and load simulation aspects.
2//!
3//! # Overview
4//! In general, the storage solutions used can be configured with the [StorageBuilder] struct.
5//! Head there to view a list of all supported options.
6//! ```
7//! use cellular_raza_core::storage::*;
8//! let builder = StorageBuilder::new()
9//!     .priority([StorageOption::SerdeJson])
10//!     .location("/tmp")
11//!     .add_date(true)
12//!     .suffix("my_awesome_sim");
13//! ```
14//! Afterwards, we can provide this builder to our chosen backend which will take the information
15//! contained in it and then construct a [StorageManager] to actually handle loading and storing.
16//!
17//! # Storage Solutions
18//! We provide multiple storage options to choose from.
19//!
20//! ## Json
21//! Relies on the [serde_json](https://docs.rs/serde_json/latest/serde_json/) crate to serialize
22//! elements and store them as plain `.json` files.
23//! See [JsonStorageInterface].
24//!
25//! ## Sled
26//! Builds an embedded database at the specified location. This database is a key-value storage and
27//! can be accessed via the [sled](https://docs.rs/sled/latest/sled/) crate.
28//! See [SledStorageInterface]
29//!
30//! ## Sled (Temp)
31//! Identical to the previous item but will remove the database after it has dropped.
32//! This options is mostly required when performing analysis steps afterwards without saving the
33//! full simulation results.
34//! See [SledStorageInterface]
35
36mod concepts;
37mod memory_storage;
38mod ron;
39mod serde_json;
40mod sled_database;
41
42mod test;
43
44pub use concepts::*;
45pub use memory_storage::*;
46pub use ron::*;
47pub use serde_json::*;
48pub use sled_database::*;