Skip to main content

NativeSessionStore

Trait NativeSessionStore 

Source
pub trait NativeSessionStore: Send + Sync {
    // Required methods
    fn load(
        &self,
        id: &SessionId,
    ) -> impl Future<Output = Result<Option<SessionState>, StoreError>> + Send;
    fn save(
        &self,
        id: &SessionId,
        state: &SessionState,
    ) -> impl Future<Output = Result<(), StoreError>> + Send;
}
Expand description

Native async session store — implement this for the cleanest developer experience.

Required Methods§

Source

fn load( &self, id: &SessionId, ) -> impl Future<Output = Result<Option<SessionState>, StoreError>> + Send

Load a session by ID.

Source

fn save( &self, id: &SessionId, state: &SessionState, ) -> impl Future<Output = Result<(), StoreError>> + Send

Save a session by ID.

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.

Implementors§