pub struct InMemorySessionService { /* private fields */ }Expand description
In-memory session service backed by DashMap for lock-free concurrent access.
Suitable for testing, prototyping, and single-process deployments. Sessions are lost on process restart.
Implementations§
Trait Implementations§
Source§impl Default for InMemorySessionService
impl Default for InMemorySessionService
Source§impl SessionService for InMemorySessionService
impl SessionService for InMemorySessionService
Source§fn create_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Session, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_session<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Session, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a new session.
Source§fn get_session<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 SessionId,
) -> Pin<Box<dyn Future<Output = Result<Option<Session>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_session<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 SessionId,
) -> Pin<Box<dyn Future<Output = Result<Option<Session>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a session by ID.
Source§fn list_sessions<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Session>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn list_sessions<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Session>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
List sessions for an app + user.
Source§fn delete_session<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 SessionId,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_session<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 SessionId,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a session.
Auto Trait Implementations§
impl Freeze for InMemorySessionService
impl !RefUnwindSafe for InMemorySessionService
impl Send for InMemorySessionService
impl Sync for InMemorySessionService
impl Unpin for InMemorySessionService
impl UnsafeUnpin for InMemorySessionService
impl UnwindSafe for InMemorySessionService
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