pub struct ScopedSessionManager { /* private fields */ }Expand description
Manages multiple SessionStore instances, one per scope.
Implementations§
Source§impl ScopedSessionManager
impl ScopedSessionManager
Sourcepub fn new(base_path: &str) -> Self
pub fn new(base_path: &str) -> Self
Create a new scoped session manager.
base_path is used as the root for deriving per-scope store file paths.
Sourcepub fn remember(
&mut self,
scope: &str,
key: &str,
value: &str,
source_step: &str,
)
pub fn remember( &mut self, scope: &str, key: &str, value: &str, source_step: &str, )
Remember a value in a scope’s ephemeral memory.
Sourcepub fn recall(&mut self, scope: &str, key: &str) -> Option<MemoryEntry>
pub fn recall(&mut self, scope: &str, key: &str) -> Option<MemoryEntry>
Recall a value from a scope’s ephemeral memory.
Sourcepub fn persist(
&mut self,
scope: &str,
key: &str,
value: &str,
source_step: &str,
)
pub fn persist( &mut self, scope: &str, key: &str, value: &str, source_step: &str, )
Persist a value in a scope’s file-backed store.
Sourcepub fn retrieve(&mut self, scope: &str, key: &str) -> Option<MemoryEntry>
pub fn retrieve(&mut self, scope: &str, key: &str) -> Option<MemoryEntry>
Retrieve a value from a scope’s file-backed store.
Sourcepub fn query(&mut self, scope: &str, query: &str) -> Vec<MemoryEntry>
pub fn query(&mut self, scope: &str, query: &str) -> Vec<MemoryEntry>
Query entries in a scope’s store.
Sourcepub fn mutate(
&mut self,
scope: &str,
key: &str,
new_value: &str,
source_step: &str,
) -> bool
pub fn mutate( &mut self, scope: &str, key: &str, new_value: &str, source_step: &str, ) -> bool
Mutate an entry in a scope’s store.
Sourcepub fn flush(&mut self, scope: &str) -> Result<(), String>
pub fn flush(&mut self, scope: &str) -> Result<(), String>
Flush a scope’s persistent store to disk.
Sourcepub fn list_scopes(&self) -> Vec<&str>
pub fn list_scopes(&self) -> Vec<&str>
List all scope names.
Sourcepub fn scope_count(&self) -> usize
pub fn scope_count(&self) -> usize
Number of active scopes.
Sourcepub fn memory_count(&self, scope: &str) -> usize
pub fn memory_count(&self, scope: &str) -> usize
Memory count for a scope (0 if scope doesn’t exist).
Sourcepub fn store_count(&self, scope: &str) -> usize
pub fn store_count(&self, scope: &str) -> usize
Store count for a scope (0 if scope doesn’t exist).
Sourcepub fn total_memory_count(&self) -> usize
pub fn total_memory_count(&self) -> usize
Total memory count across all scopes.
Sourcepub fn total_store_count(&self) -> usize
pub fn total_store_count(&self) -> usize
Total store count across all scopes.
Sourcepub fn list_entries(&mut self, scope: &str) -> Vec<ScopedEntry>
pub fn list_entries(&mut self, scope: &str) -> Vec<ScopedEntry>
List all entries in a scope (ephemeral + persistent).
Sourcepub fn summary(&self) -> Vec<ScopeSummary>
pub fn summary(&self) -> Vec<ScopeSummary>
Summary of all scopes for display/API.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScopedSessionManager
impl RefUnwindSafe for ScopedSessionManager
impl Send for ScopedSessionManager
impl Sync for ScopedSessionManager
impl Unpin for ScopedSessionManager
impl UnsafeUnpin for ScopedSessionManager
impl UnwindSafe for ScopedSessionManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more