pub struct SessionStore<O: Timeout<Sendable> + Send + Sync> { /* private fields */ }Expand description
Thread-safe session store mapping SessionId to connection state.
Implementations§
Source§impl<O: Timeout<Sendable> + Send + Sync> SessionStore<O>
impl<O: Timeout<Sendable> + Send + Sync> SessionStore<O>
Sourcepub async fn insert(&self, id: SessionId, entry: SessionEntry<O>)
pub async fn insert(&self, id: SessionId, entry: SessionEntry<O>)
Insert a new session.
Sourcepub async fn get(&self, id: &SessionId) -> Option<SessionEntry<O>>where
SessionEntry<O>: Clone,
pub async fn get(&self, id: &SessionId) -> Option<SessionEntry<O>>where
SessionEntry<O>: Clone,
Look up a session by ID.
Sourcepub async fn remove(&self, id: &SessionId) -> Option<SessionEntry<O>>
pub async fn remove(&self, id: &SessionId) -> Option<SessionEntry<O>>
Remove a session, returning the entry if it existed.
Trait Implementations§
Source§impl<O: Clone + Timeout<Sendable> + Send + Sync> Clone for SessionStore<O>
impl<O: Clone + Timeout<Sendable> + Send + Sync> Clone for SessionStore<O>
Source§fn clone(&self) -> SessionStore<O>
fn clone(&self) -> SessionStore<O>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<O> Freeze for SessionStore<O>
impl<O> !RefUnwindSafe for SessionStore<O>
impl<O> Send for SessionStore<O>
impl<O> Sync for SessionStore<O>
impl<O> Unpin for SessionStore<O>
impl<O> UnsafeUnpin for SessionStore<O>
impl<O> !UnwindSafe for SessionStore<O>
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