pub enum StorageBackend {
Memory(MemoryStorage),
FileSystem(FileSystemStorage),
Encrypted(EncryptedStorage),
}
Expand description
Enum-based storage backend for dyn compatibility
Variants§
Implementations§
Source§impl StorageBackend
impl StorageBackend
Sourcepub async fn store_session(
&self,
key: &str,
session: &SessionData,
expires_at: Option<DateTime<Utc>>,
) -> Result<()>
pub async fn store_session( &self, key: &str, session: &SessionData, expires_at: Option<DateTime<Utc>>, ) -> Result<()>
Store a session with optional expiry
Sourcepub async fn get_session(&self, key: &str) -> Result<Option<SessionData>>
pub async fn get_session(&self, key: &str) -> Result<Option<SessionData>>
Retrieve a session by key
Sourcepub async fn remove_session(&self, key: &str) -> Result<()>
pub async fn remove_session(&self, key: &str) -> Result<()>
Remove a session by key
Sourcepub async fn clear_all_sessions(&self) -> Result<()>
pub async fn clear_all_sessions(&self) -> Result<()>
Clear all sessions
Sourcepub async fn list_session_keys(&self) -> Result<Vec<String>>
pub async fn list_session_keys(&self) -> Result<Vec<String>>
List all session keys
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Check if storage is available
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StorageBackend
impl !RefUnwindSafe for StorageBackend
impl Send for StorageBackend
impl Sync for StorageBackend
impl Unpin for StorageBackend
impl !UnwindSafe for StorageBackend
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
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