pub struct RedisBackend<C> { /* private fields */ }
Available on crate feature
session
only.Expand description
Redis powered session backend
Implementations§
source§impl<C> RedisBackend<C>
impl<C> RedisBackend<C>
Trait Implementations§
source§impl<C> Clone for RedisBackend<C>where
C: Clone,
impl<C> Clone for RedisBackend<C>where
C: Clone,
source§fn clone(&self) -> RedisBackend<C>
fn clone(&self) -> RedisBackend<C>
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<C> SessionBackend for RedisBackend<C>where
C: AsyncCommands,
impl<C> SessionBackend for RedisBackend<C>where
C: AsyncCommands,
§type Error = RedisBackendError
type Error = RedisBackendError
An error occurred in backend
source§async fn get_sessions(
&mut self
) -> Result<Vec<String>, <RedisBackend<C> as SessionBackend>::Error>
async fn get_sessions( &mut self ) -> Result<Vec<String>, <RedisBackend<C> as SessionBackend>::Error>
Returns a list of available session IDs
source§async fn get_session_age(
&mut self,
session_id: &str
) -> Result<Option<u64>, <RedisBackend<C> as SessionBackend>::Error>
async fn get_session_age( &mut self, session_id: &str ) -> Result<Option<u64>, <RedisBackend<C> as SessionBackend>::Error>
Returns the time when session was created in seconds Read more
source§async fn remove_session(
&mut self,
session_id: &str
) -> Result<(), <RedisBackend<C> as SessionBackend>::Error>
async fn remove_session( &mut self, session_id: &str ) -> Result<(), <RedisBackend<C> as SessionBackend>::Error>
Removes a session Read more
source§async fn read_value(
&mut self,
session_id: &str,
key: &str
) -> Result<Option<Vec<u8>>, <RedisBackend<C> as SessionBackend>::Error>
async fn read_value( &mut self, session_id: &str, key: &str ) -> Result<Option<Vec<u8>>, <RedisBackend<C> as SessionBackend>::Error>
Read a value from store Read more
source§async fn write_value(
&mut self,
session_id: &str,
key: &str,
value: &[u8]
) -> Result<(), <RedisBackend<C> as SessionBackend>::Error>
async fn write_value( &mut self, session_id: &str, key: &str, value: &[u8] ) -> Result<(), <RedisBackend<C> as SessionBackend>::Error>
Write a value to store Read more
source§async fn remove_value(
&mut self,
session_id: &str,
key: &str
) -> Result<(), <RedisBackend<C> as SessionBackend>::Error>
async fn remove_value( &mut self, session_id: &str, key: &str ) -> Result<(), <RedisBackend<C> as SessionBackend>::Error>
Remove a value from store Read more
Auto Trait Implementations§
impl<C> Freeze for RedisBackend<C>where
C: Freeze,
impl<C> RefUnwindSafe for RedisBackend<C>where
C: RefUnwindSafe,
impl<C> Send for RedisBackend<C>where
C: Send,
impl<C> Sync for RedisBackend<C>where
C: Sync,
impl<C> Unpin for RedisBackend<C>where
C: Unpin,
impl<C> UnwindSafe for RedisBackend<C>where
C: UnwindSafe,
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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