pub struct MemorySessionStore { /* private fields */ }Expand description
In-process SessionStore backed by a HashMap of HashSets. Suitable
for tests, single-process deployments, and as the default when no
distributed store is configured. Cloning the store via Arc shares
state across all consumers.
Implementations§
Trait Implementations§
Source§impl Default for MemorySessionStore
impl Default for MemorySessionStore
Source§fn default() -> MemorySessionStore
fn default() -> MemorySessionStore
Returns the “default value” for a type. Read more
Source§impl SessionStore for MemorySessionStore
impl SessionStore for MemorySessionStore
Source§fn load_labels<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, SessionStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_labels<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, SessionStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load the union of labels accumulated for the session.
Ok(empty)
for new or unknown sessions (a confirmed key-miss); Err only on
a backend failure.Source§fn append_labels<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
labels: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<(), SessionStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn append_labels<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
labels: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<(), SessionStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Append labels to the session. Existing labels are kept; new ones
are unioned in. Caller has already deduped against
load_labels
in the hot path, but the store re-dedups defensively. Err only
on a backend failure.Auto Trait Implementations§
impl !Freeze for MemorySessionStore
impl RefUnwindSafe for MemorySessionStore
impl Send for MemorySessionStore
impl Sync for MemorySessionStore
impl Unpin for MemorySessionStore
impl UnsafeUnpin for MemorySessionStore
impl UnwindSafe for MemorySessionStore
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