pub struct RedisRateLimitStore { /* private fields */ }Expand description
RateLimitStore in Redis. Fails open: when Redis is unreachable requests
are allowed.
Implementations§
Trait Implementations§
Source§impl RateLimitStore for RedisRateLimitStore
impl RateLimitStore for RedisRateLimitStore
Source§fn hit<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
limit: u32,
window: Duration,
sliding: bool,
) -> Pin<Box<dyn Future<Output = Decision> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn hit<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
limit: u32,
window: Duration,
sliding: bool,
) -> Pin<Box<dyn Future<Output = Decision> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Count one request for
key against limit per windowAuto Trait Implementations§
impl !Freeze for RedisRateLimitStore
impl RefUnwindSafe for RedisRateLimitStore
impl Send for RedisRateLimitStore
impl Sync for RedisRateLimitStore
impl Unpin for RedisRateLimitStore
impl UnsafeUnpin for RedisRateLimitStore
impl UnwindSafe for RedisRateLimitStore
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