Struct async_fred_session::RedisSessionStore
source · pub struct RedisSessionStore { /* private fields */ }
Implementations§
source§impl RedisSessionStore
impl RedisSessionStore
sourcepub fn from_pool(pool: RedisPool, prefix: Option<String>) -> Self
pub fn from_pool(pool: RedisPool, prefix: Option<String>) -> Self
creates a redis store from an existing fred::pool::RedisPool
use async_fred_session::RedisSessionStore;
use async_session::{Session, SessionStore};
use fred::{pool::RedisPool, prelude::*};
let conf = RedisConfig::from_url("redis://127.0.0.1:6379").unwrap();
let pool = RedisPool::new(conf, None, None, 6).unwrap();
pool.connect();
pool.wait_for_connect().await.unwrap();
let store = RedisSessionStore::from_pool(pool, Some("async-fred-session/".into()));
Trait Implementations§
source§impl Clone for RedisSessionStore
impl Clone for RedisSessionStore
source§fn clone(&self) -> RedisSessionStore
fn clone(&self) -> RedisSessionStore
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RedisSessionStore
impl Debug for RedisSessionStore
source§impl SessionStore for RedisSessionStore
impl SessionStore for RedisSessionStore
source§fn load_session<'life0, 'async_trait>(
&'life0 self,
cookie_value: String
) -> Pin<Box<dyn Future<Output = Result<Option<Session>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_session<'life0, 'async_trait>( &'life0 self, cookie_value: String ) -> Pin<Box<dyn Future<Output = Result<Option<Session>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Get a session from the storage backend. Read more
source§fn store_session<'life0, 'async_trait>(
&'life0 self,
session: Session
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store_session<'life0, 'async_trait>( &'life0 self, session: Session ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Store a session on the storage backend. Read more