pub struct RedisBackend { /* private fields */ }
Available on crate feature
redis
only.Expand description
A Fixed Window rate limiter Backend that uses stores data in Redis.
Implementations§
Source§impl RedisBackend
impl RedisBackend
Sourcepub fn builder(connection: ConnectionManager) -> Builder
pub fn builder(connection: ConnectionManager) -> Builder
Create a RedisBackendBuilder.
§Arguments
pool
: A Redis connection pool
§Examples
let client = redis::Client::open("redis://127.0.0.1/").unwrap();
let manager = ConnectionManager::new(client).await.unwrap();
let backend = RedisBackend::builder(manager).build();
Trait Implementations§
Source§impl Backend for RedisBackend
impl Backend for RedisBackend
Source§impl Clone for RedisBackend
impl Clone for RedisBackend
Source§fn clone(&self) -> RedisBackend
fn clone(&self) -> RedisBackend
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 SimpleBackend for RedisBackend
impl SimpleBackend for RedisBackend
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