pub struct InMemorySessionStore { /* private fields */ }Expand description
Thread-safe, in-memory session store backed by scc::HashMap.
Suitable for single-process / CLI usage where persistence across restarts is not required.
Implementations§
Trait Implementations§
Source§impl Debug for InMemorySessionStore
impl Debug for InMemorySessionStore
Source§impl Default for InMemorySessionStore
impl Default for InMemorySessionStore
Source§impl SessionStore for InMemorySessionStore
impl SessionStore for InMemorySessionStore
Source§fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 SessionId,
) -> Pin<Box<dyn Future<Output = Result<Option<SessionState>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 SessionId,
) -> Pin<Box<dyn Future<Output = Result<Option<SessionState>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load a session by ID. Returns
None if not found.Source§fn save<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 SessionId,
state: &'life2 SessionState,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 SessionId,
state: &'life2 SessionState,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Persist a session by ID.
Auto Trait Implementations§
impl !Freeze for InMemorySessionStore
impl RefUnwindSafe for InMemorySessionStore
impl Send for InMemorySessionStore
impl Sync for InMemorySessionStore
impl Unpin for InMemorySessionStore
impl UnsafeUnpin for InMemorySessionStore
impl UnwindSafe for InMemorySessionStore
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