pub struct MemoryStorage { /* private fields */ }Expand description
Storage for memory files (global and project-level) with file locking.
Implementations§
Source§impl MemoryStorage
impl MemoryStorage
Sourcepub fn with_lock_timeout(
project_root: Option<&Path>,
timeout_ms: u64,
) -> Result<Self>
pub fn with_lock_timeout( project_root: Option<&Path>, timeout_ms: u64, ) -> Result<Self>
Create a new storage with explicit lock timeout.
Sourcepub fn global_memory_path(&self) -> PathBuf
pub fn global_memory_path(&self) -> PathBuf
Path to global memory file.
Sourcepub fn project_memory_path(&self) -> Option<PathBuf>
pub fn project_memory_path(&self) -> Option<PathBuf>
Path to project memory file.
Sourcepub fn config_path(&self) -> PathBuf
pub fn config_path(&self) -> PathBuf
Path to config file.
Sourcepub fn load_global(&self) -> Result<AutoMemory>
pub fn load_global(&self) -> Result<AutoMemory>
Load global memory.
Sourcepub fn load_project(&self) -> Result<Option<AutoMemory>>
pub fn load_project(&self) -> Result<Option<AutoMemory>>
Load project memory.
Sourcepub fn load_combined(&self) -> Result<AutoMemory>
pub fn load_combined(&self) -> Result<AutoMemory>
Load combined memory (global + project).
Sourcepub fn save_global(&mut self, memory: &AutoMemory) -> Result<()>
pub fn save_global(&mut self, memory: &AutoMemory) -> Result<()>
Save global memory (with file lock).
Sourcepub fn save_project(&mut self, memory: &AutoMemory) -> Result<()>
pub fn save_project(&mut self, memory: &AutoMemory) -> Result<()>
Save project memory (with file lock).
Sourcepub fn save_config(&mut self, config: &MemoryConfig) -> Result<()>
pub fn save_config(&mut self, config: &MemoryConfig) -> Result<()>
Save config to separate file.
Sourcepub fn load_config(&self) -> Result<MemoryConfig>
pub fn load_config(&self) -> Result<MemoryConfig>
Load config from file.
Auto Trait Implementations§
impl Freeze for MemoryStorage
impl RefUnwindSafe for MemoryStorage
impl Send for MemoryStorage
impl Sync for MemoryStorage
impl Unpin for MemoryStorage
impl UnsafeUnpin for MemoryStorage
impl UnwindSafe for MemoryStorage
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