pub struct RedisBackend { /* private fields */ }Expand description
The instance of SessionBackend which uses Redis.
Implementations§
Source§impl RedisBackend
impl RedisBackend
Sourcepub fn new(client: Client) -> RedisBackend
pub fn new(client: Client) -> RedisBackend
Create a new RedisSessionBackend from the specified Redis client.
Sourcepub fn key_prefix(self, prefix: impl Into<String>) -> RedisBackend
pub fn key_prefix(self, prefix: impl Into<String>) -> RedisBackend
Set the prefix string used in the key name when stores the session value to Redis.
The default value is “finchers-session”
Set the name of Cookie entry which stores the session id.
The default value is “session-id”
Sourcepub fn timeout(self, timeout: Duration) -> RedisBackend
pub fn timeout(self, timeout: Duration) -> RedisBackend
Set the timeout of session value.
Trait Implementations§
Source§impl Clone for RedisBackend
impl Clone for RedisBackend
Source§fn clone(&self) -> RedisBackend
fn clone(&self) -> RedisBackend
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 Debug for RedisBackend
impl Debug for RedisBackend
Source§impl<'a> Endpoint<'a> for RedisBackend
impl<'a> Endpoint<'a> for RedisBackend
Source§type Output = (Session<RedisSession>,)
type Output = (Session<RedisSession>,)
The inner type associated with this endpoint.
Source§fn apply(&self, cx: &mut ApplyContext<'_>) -> ApplyResult<Self::Future>
fn apply(&self, cx: &mut ApplyContext<'_>) -> ApplyResult<Self::Future>
Perform checking the incoming HTTP request and returns
an instance of the associated Future if matched.
Source§fn with_output<T>(self) -> Self
fn with_output<T>(self) -> Self
Add an annotation that the associated type
Output is fixed to T.Auto Trait Implementations§
impl Freeze for RedisBackend
impl RefUnwindSafe for RedisBackend
impl Send for RedisBackend
impl Sync for RedisBackend
impl Unpin for RedisBackend
impl UnwindSafe for RedisBackend
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<'a, E> EndpointWrapExt<'a> for Ewhere
E: Endpoint<'a>,
impl<'a, E> EndpointWrapExt<'a> for Ewhere
E: Endpoint<'a>,
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