pub struct RedisSessionStore { /* private fields */ }Available on crate feature
redis-rs-session only.Expand description
Implementations§
Source§impl RedisSessionStore
impl RedisSessionStore
Sourcepub fn builder<S: Into<String>>(
connection_string: S,
) -> RedisSessionStoreBuilder
pub fn builder<S: Into<String>>( connection_string: S, ) -> RedisSessionStoreBuilder
A fluent API to configure RedisSessionStore.
It takes as input the only required input to create a new instance of RedisSessionStore - a
connection string for Redis.
Sourcepub async fn new<S: Into<String>>(
connection_string: S,
) -> Result<RedisSessionStore, Error>
pub async fn new<S: Into<String>>( connection_string: S, ) -> Result<RedisSessionStore, Error>
Create a new instance of RedisSessionStore using the default configuration.
It takes as input the only required input to create a new instance of RedisSessionStore - a
connection string for Redis.
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§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl SessionStore for RedisSessionStore
impl SessionStore for RedisSessionStore
Source§fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
session_key: &'life1 SessionKey,
) -> Pin<Box<dyn Future<Output = Result<Option<Map<String, Value>>, LoadError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
session_key: &'life1 SessionKey,
) -> Pin<Box<dyn Future<Output = Result<Option<Map<String, Value>>, LoadError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Loads the session state associated to a session key.
Source§fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
session_state: Map<String, Value>,
ttl: &'life1 Duration,
) -> Pin<Box<dyn Future<Output = Result<SessionKey, SaveError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
session_state: Map<String, Value>,
ttl: &'life1 Duration,
) -> Pin<Box<dyn Future<Output = Result<SessionKey, SaveError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Persist the session state for a newly created session. Read more
Source§fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
session_key: SessionKey,
session_state: Map<String, Value>,
ttl: &'life1 Duration,
) -> Pin<Box<dyn Future<Output = Result<SessionKey, UpdateError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
session_key: SessionKey,
session_state: Map<String, Value>,
ttl: &'life1 Duration,
) -> Pin<Box<dyn Future<Output = Result<SessionKey, UpdateError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Updates the session state associated to a pre-existing session key.
Source§fn update_ttl<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_key: &'life1 SessionKey,
ttl: &'life2 Duration,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn update_ttl<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_key: &'life1 SessionKey,
ttl: &'life2 Duration,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Updates the TTL of the session state associated to a pre-existing session key.
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