pub struct MemorySessionStorage { /* private fields */ }Expand description
In-memory session storage implementation
Warning: This is for development/testing only. Sessions will be lost on restart.
Implementations§
Trait Implementations§
Source§impl Debug for MemorySessionStorage
impl Debug for MemorySessionStorage
Source§impl Default for MemorySessionStorage
impl Default for MemorySessionStorage
Source§impl SessionStorage for MemorySessionStorage
impl SessionStorage for MemorySessionStorage
type SessionId = SessionId
type SessionData = SessionData
Source§fn create_session<'life0, 'async_trait>(
&'life0 self,
data: Self::SessionData,
expires_at: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = AuthResult<Self::SessionId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_session<'life0, 'async_trait>(
&'life0 self,
data: Self::SessionData,
expires_at: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = AuthResult<Self::SessionId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a new session
Source§fn get_session<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Self::SessionId,
) -> Pin<Box<dyn Future<Output = AuthResult<Option<Self::SessionData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_session<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Self::SessionId,
) -> Pin<Box<dyn Future<Output = AuthResult<Option<Self::SessionData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get session data by ID
Source§fn update_session<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Self::SessionId,
data: Self::SessionData,
expires_at: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_session<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Self::SessionId,
data: Self::SessionData,
expires_at: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update session data
Source§fn delete_session<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Self::SessionId,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_session<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Self::SessionId,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a session
Source§fn cleanup_expired_sessions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AuthResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cleanup_expired_sessions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AuthResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clean up expired sessions
Auto Trait Implementations§
impl !RefUnwindSafe for MemorySessionStorage
impl !UnwindSafe for MemorySessionStorage
impl Freeze for MemorySessionStorage
impl Send for MemorySessionStorage
impl Sync for MemorySessionStorage
impl Unpin for MemorySessionStorage
impl UnsafeUnpin for MemorySessionStorage
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more