Struct actix_extensible_rate_limit::backend::redis::RedisBackend
source · 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
type Output = SimpleOutput
type RollbackToken = String
type Error = Error
source§async fn request(
&self,
input: SimpleInput,
) -> Result<(Decision, Self::Output, Self::RollbackToken), Self::Error>
async fn request( &self, input: SimpleInput, ) -> Result<(Decision, Self::Output, Self::RollbackToken), Self::Error>
Process an incoming request. Read more
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)