pub struct SessionPersistence { /* private fields */ }Expand description
Session persistence manager
Implementations§
Source§impl SessionPersistence
impl SessionPersistence
Sourcepub fn load(&self) -> Vec<PersistedSession>
pub fn load(&self) -> Vec<PersistedSession>
Load persisted sessions
Sourcepub fn save(&self, sessions: &[PersistedSession]) -> Result<()>
pub fn save(&self, sessions: &[PersistedSession]) -> Result<()>
Save sessions to disk
Sourcepub fn add_session(&self, session: PersistedSession) -> Result<()>
pub fn add_session(&self, session: PersistedSession) -> Result<()>
Add a session to persistence
Sourcepub fn remove_session(&self, session_id: &str) -> Result<()>
pub fn remove_session(&self, session_id: &str) -> Result<()>
Remove a session from persistence
Sourcepub fn update_session(&self, session: PersistedSession) -> Result<()>
pub fn update_session(&self, session: PersistedSession) -> Result<()>
Update a session in persistence
Sourcepub fn get_session(&self, session_id: &str) -> Option<PersistedSession>
pub fn get_session(&self, session_id: &str) -> Option<PersistedSession>
Get a persisted session by ID
Sourcepub fn cleanup_stale_sessions(&self) -> Result<usize>
pub fn cleanup_stale_sessions(&self) -> Result<usize>
Clean up stale sessions (processes that are no longer running)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SessionPersistence
impl RefUnwindSafe for SessionPersistence
impl Send for SessionPersistence
impl Sync for SessionPersistence
impl Unpin for SessionPersistence
impl UnsafeUnpin for SessionPersistence
impl UnwindSafe for SessionPersistence
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.