pub trait SessionStore: Send + Sync {
// Required methods
fn insert_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 StoredSession,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_session<'life0, 'async_trait>(
&'life0 self,
session_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<StoredSession, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 StoredSession,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_expired_sessions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_sessions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<StoredSession>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Async storage trait for task session records.
Required Methods§
Sourcefn insert_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 StoredSession,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn insert_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 StoredSession,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Insert a new session.
Sourcefn get_session<'life0, 'async_trait>(
&'life0 self,
session_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<StoredSession, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_session<'life0, 'async_trait>(
&'life0 self,
session_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<StoredSession, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get a session by ID.
Sourcefn update_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 StoredSession,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session: &'life1 StoredSession,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update a session (full replacement).
Sourcefn delete_expired_sessions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_expired_sessions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete expired sessions. Returns the number removed.
Sourcefn list_sessions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<StoredSession>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_sessions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<StoredSession>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all sessions.