pub struct InMemorySessionStore { /* private fields */ }Expand description
High-concurrency 64-way sharded bounded in-memory SessionStore.
Implementations§
Source§impl InMemorySessionStore
Inherent implementation of InMemorySessionStore.
impl InMemorySessionStore
Inherent implementation of InMemorySessionStore.
Sourcepub fn new(max_sessions: usize) -> Self
pub fn new(max_sessions: usize) -> Self
Creates a 64-way sharded bounded InMemorySessionStore capped at max_sessions.
§Arguments
usize- Maximum concurrent tracked sessions.
§Returns
Self- Ready sharded session store.
Trait Implementations§
Source§impl Clone for InMemorySessionStore
impl Clone for InMemorySessionStore
Source§impl Default for InMemorySessionStore
Default construction for InMemorySessionStore.
impl Default for InMemorySessionStore
Default construction for InMemorySessionStore.
Source§fn default() -> Self
fn default() -> Self
Constructs a default 64-shard InMemorySessionStore.
Source§impl SessionStore for InMemorySessionStore
Implements SessionStore for InMemorySessionStore.
impl SessionStore for InMemorySessionStore
Implements SessionStore for InMemorySessionStore.
Source§fn load<'a>(
&'a self,
session_id: &'a str,
) -> SessionFuture<'a, Option<HashMap<String, String>>>
fn load<'a>( &'a self, session_id: &'a str, ) -> SessionFuture<'a, Option<HashMap<String, String>>>
Source§fn save(
&self,
session_id: String,
values: HashMap<String, String>,
ttl_secs: u64,
) -> SessionFuture<'_, ()>
fn save( &self, session_id: String, values: HashMap<String, String>, ttl_secs: u64, ) -> SessionFuture<'_, ()>
Source§fn purge_expired(&self) -> usize
fn purge_expired(&self) -> usize
Auto Trait Implementations§
impl Forget for InMemorySessionStore
impl Freeze for InMemorySessionStore
impl Move 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§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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