pub struct FileSessionStore { /* private fields */ }Expand description
Durable session store backed by per-session JSON files.
Session snapshots are cached in-memory for fast reads and also persisted on every save so process restarts can recover context.
Implementations§
Trait Implementations§
Source§impl Debug for FileSessionStore
impl Debug for FileSessionStore
Source§impl SessionStore for FileSessionStore
impl SessionStore for FileSessionStore
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. Increments the version unconditionally.
Source§fn save_if_version<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 SessionId,
state: &'life2 SessionState,
expected_version: u64,
) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save_if_version<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 SessionId,
state: &'life2 SessionState,
expected_version: u64,
) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Persist a session only if the current version matches
expected_version. Read moreAuto Trait Implementations§
impl !Freeze for FileSessionStore
impl !RefUnwindSafe for FileSessionStore
impl Send for FileSessionStore
impl Sync for FileSessionStore
impl Unpin for FileSessionStore
impl UnsafeUnpin for FileSessionStore
impl !UnwindSafe for FileSessionStore
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