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 duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const 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
Auto Trait Implementations§
impl Freeze for RedisSessionStore
impl !RefUnwindSafe for RedisSessionStore
impl Send for RedisSessionStore
impl Sync for RedisSessionStore
impl Unpin for RedisSessionStore
impl !UnwindSafe for RedisSessionStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more