pub struct MemorySessionStore { /* private fields */ }Expand description
Sessions held in this process’s memory.
Right for development, tests, and a single instance. Two instances behind a load balancer will not see each other’s sessions, so a user’s session appears to vanish and reappear as they are routed around — which looks like a bug in your login code and is not.
Implementations§
Trait Implementations§
Source§impl Debug for MemorySessionStore
impl Debug for MemorySessionStore
Source§impl Default for MemorySessionStore
impl Default for MemorySessionStore
Source§impl SessionStore for MemorySessionStore
impl SessionStore for MemorySessionStore
Source§fn read<'a>(&'a self, id: &'a str) -> BoxFuture<'a, Result<Option<SessionData>>>
fn read<'a>(&'a self, id: &'a str) -> BoxFuture<'a, Result<Option<SessionData>>>
The data for this id, or
None if it is unknown or expired.Source§fn write<'a>(
&'a self,
id: &'a str,
data: &'a SessionData,
) -> BoxFuture<'a, Result<()>>
fn write<'a>( &'a self, id: &'a str, data: &'a SessionData, ) -> BoxFuture<'a, Result<()>>
Write the data back, refreshing its expiry.
Source§fn gc(&self) -> BoxFuture<'_, Result<u64>>
fn gc(&self) -> BoxFuture<'_, Result<u64>>
Discard every expired session. Called periodically, not per request.
Source§fn is_client_side(&self) -> bool
fn is_client_side(&self) -> bool
Whether the session travels in the cookie rather than being stored here. Read more
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Event for T
impl<T> Event for T
Source§fn event_name() -> &'static strwhere
Self: Sized,
fn event_name() -> &'static strwhere
Self: Sized,
A human-readable name, used by wildcard listeners and log output.
Always the Rust type path; see the trait docs.