pub struct InMemorySessionStore { /* private fields */ }Implementations§
Trait Implementations§
Source§impl Default for InMemorySessionStore
impl Default for InMemorySessionStore
Source§impl SessionStore for InMemorySessionStore
impl SessionStore for InMemorySessionStore
Source§fn create<'life0, 'async_trait>(
&'life0 self,
record: SessionRecord,
) -> Pin<Box<dyn Future<Output = Result<String, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create<'life0, 'async_trait>(
&'life0 self,
record: SessionRecord,
) -> Pin<Box<dyn Future<Output = Result<String, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a new session
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<SessionRecord>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<SessionRecord>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a session by ID
Source§fn update<'life0, 'async_trait>(
&'life0 self,
record: SessionRecord,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update<'life0, 'async_trait>(
&'life0 self,
record: SessionRecord,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update session (e.g., extend expiration, update metadata)
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a session (logout)
Source§fn delete_by_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
tenant_id: &'life2 TenantId,
) -> Pin<Box<dyn Future<Output = Result<usize, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete_by_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
tenant_id: &'life2 TenantId,
) -> Pin<Box<dyn Future<Output = Result<usize, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Delete all sessions for a user (force logout)
Source§fn extend<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
duration: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn extend<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
duration: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Extend session expiration (sliding window)
Source§fn touch<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn touch<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update last activity timestamp
Source§fn cleanup_expired<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cleanup_expired<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Cleanup expired sessions (background job)
Source§fn list_by_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
tenant_id: &'life2 TenantId,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionRecord>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn list_by_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
tenant_id: &'life2 TenantId,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionRecord>, SessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
List active sessions for a user
Auto Trait Implementations§
impl !RefUnwindSafe for InMemorySessionStore
impl !UnwindSafe for InMemorySessionStore
impl Freeze for InMemorySessionStore
impl Send for InMemorySessionStore
impl Sync for InMemorySessionStore
impl Unpin for InMemorySessionStore
impl UnsafeUnpin 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