pub trait SessionStore:
Send
+ Sync
+ 'static {
// Required methods
fn create(&self, id: &str) -> impl Future<Output = SessionInfo> + Send;
fn get(&self, id: &str) -> impl Future<Output = Option<SessionInfo>> + Send;
fn touch(&self, id: &str) -> impl Future<Output = ()> + Send;
fn update_state(
&self,
id: &str,
state: SessionState,
) -> impl Future<Output = ()> + Send;
fn set_client_info(
&self,
id: &str,
info: ClientInfo,
) -> impl Future<Output = ()> + Send;
fn remove(&self, id: &str) -> impl Future<Output = ()> + Send;
fn list(&self) -> impl Future<Output = Vec<SessionInfo>> + Send;
}Expand description
Trait for session storage backends. Async to support I/O-backed stores (Redis, database, logging).
Required Methods§
fn create(&self, id: &str) -> impl Future<Output = SessionInfo> + Send
fn get(&self, id: &str) -> impl Future<Output = Option<SessionInfo>> + Send
fn touch(&self, id: &str) -> impl Future<Output = ()> + Send
fn update_state( &self, id: &str, state: SessionState, ) -> impl Future<Output = ()> + Send
fn set_client_info( &self, id: &str, info: ClientInfo, ) -> impl Future<Output = ()> + Send
fn remove(&self, id: &str) -> impl Future<Output = ()> + Send
fn list(&self) -> impl Future<Output = Vec<SessionInfo>> + Send
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.