Skip to main content

SessionStore

Trait SessionStore 

Source
pub trait SessionStore: Send + Sync {
    // Required methods
    fn save(&self, snapshot: &SessionSnapshot) -> Result<(), StoreError>;
    fn load(
        &self,
        session_id: &str,
    ) -> Result<Option<SessionSnapshot>, StoreError>;
    fn delete(&self, session_id: &str) -> Result<(), StoreError>;
    fn list(&self) -> Result<Vec<String>, StoreError>;
}
Expand description

Trait for session persistence backends.

Required Methods§

Source

fn save(&self, snapshot: &SessionSnapshot) -> Result<(), StoreError>

Save a session snapshot.

Source

fn load(&self, session_id: &str) -> Result<Option<SessionSnapshot>, StoreError>

Load a session snapshot by ID.

Source

fn delete(&self, session_id: &str) -> Result<(), StoreError>

Delete a session.

Source

fn list(&self) -> Result<Vec<String>, StoreError>

List all stored session IDs.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§