pub struct RedisSessionStore { /* private fields */ }
Expand description
§RedisSessionStore
Implementations§
Source§impl RedisSessionStore
impl RedisSessionStore
Sourcepub fn from_client(client: Client) -> Self
pub fn from_client(client: Client) -> Self
creates a redis store from an existing redis::Client
let client = redis::Client::open("redis://127.0.0.1").unwrap();
let store = RedisSessionStore::from_client(client);
Sourcepub fn new(connection_info: impl IntoConnectionInfo) -> RedisResult<Self>
pub fn new(connection_info: impl IntoConnectionInfo) -> RedisResult<Self>
creates a redis store from a redis::IntoConnectionInfo
such as a String
, &str
, or Url
let store = RedisSessionStore::new("redis://127.0.0.1").unwrap();
Sourcepub fn with_prefix(self, prefix: impl AsRef<str>) -> Self
pub fn with_prefix(self, prefix: impl AsRef<str>) -> Self
sets a key prefix for this session store
let store = RedisSessionStore::new("redis://127.0.0.1").unwrap()
.with_prefix("async-sessions/");
let client = redis::Client::open("redis://127.0.0.1").unwrap();
let store = RedisSessionStore::from_client(client)
.with_prefix("async-sessions/");
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
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