SessionStore

Trait SessionStore 

Source
pub trait SessionStore: Send {
    type Session;
    type Key: SessionKey;

    // Required methods
    fn create_session<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(Self::Key, Self::Session)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn load_session<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 Self::Key,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Self::Session>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Associated Types§

Required Methods§

Source

fn create_session<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(Self::Key, Self::Session)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn load_session<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 Self::Key, ) -> Pin<Box<dyn Future<Output = Result<Option<Self::Session>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§

Source§

impl<S, K> SessionStore for InMemorySessionStore<S, K>
where S: CreateNew, K: SessionKey + Clone + Eq + Hash + Send + Sync,

Source§

type Session = Arc<S>

Source§

type Key = K