pub struct SisterConfig {
pub data_path: Option<PathBuf>,
pub data_paths: HashMap<String, PathBuf>,
pub create_if_missing: bool,
pub read_only: bool,
pub memory_budget_mb: Option<usize>,
pub options: HashMap<String, Value>,
}Expand description
Configuration for initializing a sister.
v0.2.0: Made data paths flexible to support sisters with different storage models:
- Memory/Vision: single data file (
data_path) - Identity: multiple directories (
data_paths) - Codebase: multiple graph files loaded dynamically
- Time: single data file
Fields§
§data_path: Option<PathBuf>Primary data file/directory path. Used by sisters with a single data location (Memory, Vision, Time)
data_paths: HashMap<String, PathBuf>Additional named data paths. Used by sisters with multiple data locations (Identity, Codebase).
Examples:
- Identity: {“identities”: “/path/to/identities”, “receipts”: “/path/to/receipts”}
- Codebase: {“default_graph”: “/path/to/graph.acb”}
create_if_missing: boolWhether to create if not exists
read_only: boolRead-only mode
memory_budget_mb: Option<usize>Memory budget in megabytes (optional)
options: HashMap<String, Value>Custom options (sister-specific)
Implementations§
Source§impl SisterConfig
impl SisterConfig
Sourcepub fn with_paths(paths: HashMap<String, PathBuf>) -> Self
pub fn with_paths(paths: HashMap<String, PathBuf>) -> Self
Create a config with multiple named paths (for Identity, Codebase)
Sourcepub fn primary_path(&self) -> PathBuf
pub fn primary_path(&self) -> PathBuf
Get the primary data path, falling back to “.” if none set
Sourcepub fn add_path(self, name: impl Into<String>, path: impl Into<PathBuf>) -> Self
pub fn add_path(self, name: impl Into<String>, path: impl Into<PathBuf>) -> Self
Add a named data path
Sourcepub fn create_if_missing(self, create: bool) -> Self
pub fn create_if_missing(self, create: bool) -> Self
Set create if missing
Sourcepub fn memory_budget(self, mb: usize) -> Self
pub fn memory_budget(self, mb: usize) -> Self
Set memory budget
Sourcepub fn get_option<T: for<'de> Deserialize<'de>>(&self, key: &str) -> Option<T>
pub fn get_option<T: for<'de> Deserialize<'de>>(&self, key: &str) -> Option<T>
Get a custom option
Trait Implementations§
Source§impl Clone for SisterConfig
impl Clone for SisterConfig
Source§fn clone(&self) -> SisterConfig
fn clone(&self) -> SisterConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SisterConfig
impl Debug for SisterConfig
Source§impl Default for SisterConfig
impl Default for SisterConfig
Source§impl<'de> Deserialize<'de> for SisterConfig
impl<'de> Deserialize<'de> for SisterConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SisterConfig
impl RefUnwindSafe for SisterConfig
impl Send for SisterConfig
impl Sync for SisterConfig
impl Unpin for SisterConfig
impl UnsafeUnpin for SisterConfig
impl UnwindSafe for SisterConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more