pub struct MemorySessionStore { /* private fields */ }Expand description
In-memory session backend.
Implementations§
Source§impl MemorySessionStore
impl MemorySessionStore
pub fn new() -> MemorySessionStore
Trait Implementations§
Source§impl Clone for MemorySessionStore
impl Clone for MemorySessionStore
Source§fn clone(&self) -> MemorySessionStore
fn clone(&self) -> MemorySessionStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<Vec<u8>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemorySessionStore: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<Vec<u8>>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemorySessionStore: 'async_trait,
Reads a session blob keyed by
id. Returns None if the session does
not exist or has expired.Source§fn store<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
data: Vec<u8>,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemorySessionStore: 'async_trait,
fn store<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
data: Vec<u8>,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemorySessionStore: 'async_trait,
Inserts or replaces the session blob for
id with the configured TTL.Source§fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemorySessionStore: 'async_trait,
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemorySessionStore: 'async_trait,
Removes the session, returning whether the key existed.
Source§fn sweep<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
MemorySessionStore: 'async_trait,
fn sweep<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
MemorySessionStore: 'async_trait,
Optional sweep hook. The default in-memory store schedules its own
janitor; remote backends typically rely on TTL expiry inside the
underlying database (e.g. Redis
EXPIRE).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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more