Struct tower_sessions::RedisStore
source ยท pub struct RedisStore { /* private fields */ }Available on crate feature
redis-store only.Expand description
A Redis session store.
Implementationsยง
sourceยงimpl RedisStore
impl RedisStore
sourcepub fn new(client: RedisClient) -> Self
pub fn new(client: RedisClient) -> Self
Create a new Redis store with the provided client.
Examples
use fred::prelude::*;
use tower_sessions::RedisStore;
let config = RedisConfig::from_url("redis://127.0.0.1:6379/1").unwrap();
let client = RedisClient::new(config, None, None);
let _ = client.connect();
client.wait_for_connect().await.unwrap();
let session_store = RedisStore::new(client);
})Trait Implementationsยง
sourceยงimpl Clone for RedisStore
impl Clone for RedisStore
sourceยงfn clone(&self) -> RedisStore
fn clone(&self) -> RedisStore
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 Default for RedisStore
impl Default for RedisStore
sourceยงfn default() -> RedisStore
fn default() -> RedisStore
Returns the โdefault valueโ for a type. Read more
sourceยงimpl SessionStore for RedisStore
impl SessionStore for RedisStore
sourceยงfn save<'life0, 'life1, 'async_trait>(
&'life0 self,
session_record: &'life1 SessionRecord
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>( &'life0 self, session_record: &'life1 SessionRecord ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
A method for saving a session in a store.
Auto Trait Implementationsยง
impl !RefUnwindSafe for RedisStore
impl Send for RedisStore
impl Sync for RedisStore
impl Unpin for RedisStore
impl !UnwindSafe for RedisStore
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