pub struct InMemorySessionStore { /* private fields */ }
Expand description
In-memory session store implementation
Stores session data in a thread-safe HashMap, using a read-write lock for concurrent access and mutexes for individual session streams.
Implementations§
Trait Implementations§
Source§impl Clone for InMemorySessionStore
impl Clone for InMemorySessionStore
Source§fn clone(&self) -> InMemorySessionStore
fn clone(&self) -> InMemorySessionStore
Returns a copy 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 moreSource§impl Default for InMemorySessionStore
impl Default for InMemorySessionStore
Source§fn default() -> InMemorySessionStore
fn default() -> InMemorySessionStore
Returns the “default value” for a type. Read more
Source§impl SessionStore for InMemorySessionStore
Implementation of the SessionStore trait for InMemorySessionStore
impl SessionStore for InMemorySessionStore
Implementation of the SessionStore trait for InMemorySessionStore
Provides asynchronous methods for managing sessions in memory, ensuring thread-safety through read-write locks and mutexes.
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SessionId,
) -> Pin<Box<dyn Future<Output = Option<Arc<Mutex<TxServer>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SessionId,
) -> Pin<Box<dyn Future<Output = Option<Arc<Mutex<TxServer>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves a session by its identifier Read more
Source§fn set<'life0, 'async_trait>(
&'life0 self,
key: SessionId,
value: TxServer,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set<'life0, 'async_trait>(
&'life0 self,
key: SessionId,
value: TxServer,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stores a new session with the given identifier Read more
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SessionId,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SessionId,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes a session by its identifier Read more
Source§fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clears all sessions from the store
fn keys<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<SessionId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn values<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<Arc<Mutex<DuplexStream>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl Freeze for InMemorySessionStore
impl !RefUnwindSafe for InMemorySessionStore
impl Send for InMemorySessionStore
impl Sync for InMemorySessionStore
impl Unpin for InMemorySessionStore
impl !UnwindSafe for InMemorySessionStore
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