Trait sessions_core::Storage
source · pub trait Storage: Send + Sync {
// Required methods
fn get(
&self,
key: &str
) -> impl Future<Output = Result<Option<Data>>> + Send;
fn set(
&self,
key: &str,
val: Data,
exp: &Duration
) -> impl Future<Output = Result<()>> + Send;
fn remove(&self, key: &str) -> impl Future<Output = Result<()>> + Send;
// Provided methods
fn reset(&self) -> impl Future<Output = Result<()>> + Send { ... }
fn close(&self) -> impl Future<Output = Result<()>> + Send { ... }
}
Expand description
A Storage Trait
Required Methods§
sourcefn get(&self, key: &str) -> impl Future<Output = Result<Option<Data>>> + Send
fn get(&self, key: &str) -> impl Future<Output = Result<Option<Data>>> + Send
Gets a Data
from storage by the key
Provided Methods§
Object Safety§
This trait is not object safe.