pub trait SessionStore:
Send
+ Sync
+ 'static {
// Required methods
fn load(
&self,
id: &str,
) -> impl Future<Output = Result<Option<HashMap<String, String>>, SessionStoreError>> + Send;
fn save(
&self,
id: &str,
data: HashMap<String, String>,
) -> impl Future<Output = Result<(), SessionStoreError>> + Send;
fn destroy(
&self,
id: &str,
) -> impl Future<Output = Result<(), SessionStoreError>> + Send;
}Expand description
Pluggable session storage backend.
Implement this trait to store sessions in Redis, a database, etc.
The default implementation is MemoryStore.
Required Methods§
Sourcefn load(
&self,
id: &str,
) -> impl Future<Output = Result<Option<HashMap<String, String>>, SessionStoreError>> + Send
fn load( &self, id: &str, ) -> impl Future<Output = Result<Option<HashMap<String, String>>, SessionStoreError>> + Send
Load session data for the given ID. Returns None if the session
does not exist or has expired.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.