pub struct RedisStore { /* private fields */ }Expand description
Redis-backed implementation of the common fixed-window Store seam.
The connection is supplied by the caller and is cloned for each increment. A Redis
MultiplexedConnection clone shares its underlying connection and does not transfer
connection lifecycle ownership to this adapter. Window durations are truncated to whole
milliseconds because Redis expiry commands use millisecond precision; values shorter than one
millisecond are rejected.
Implementations§
Source§impl RedisStore
impl RedisStore
Sourcepub fn new(connection: MultiplexedConnection) -> Self
pub fn new(connection: MultiplexedConnection) -> Self
Construct a store from an established Redis multiplexed connection.
Sourcepub fn with_namespace(self, namespace: impl Into<String>) -> Self
pub fn with_namespace(self, namespace: impl Into<String>) -> Self
Add an optional namespace. Empty namespaces are treated as absent.
Trait Implementations§
Source§impl Clone for RedisStore
impl Clone for RedisStore
Source§fn clone(&self) -> RedisStore
fn clone(&self) -> RedisStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RedisStore
impl Debug for RedisStore
Auto Trait Implementations§
impl Freeze for RedisStore
impl RefUnwindSafe for RedisStore
impl Send for RedisStore
impl Sync for RedisStore
impl Unpin for RedisStore
impl UnsafeUnpin 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