pub struct KeyedRateLimiter { /* private fields */ }Expand description
Sliding-window rate limiter keyed by an arbitrary string (e.g. email or IP).
Returns true from Self::check_and_record when the request is allowed,
false when the caller has exceeded max_requests within window.
Implementations§
Trait Implementations§
Source§impl Clone for KeyedRateLimiter
impl Clone for KeyedRateLimiter
Source§fn clone(&self) -> KeyedRateLimiter
fn clone(&self) -> KeyedRateLimiter
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 moreAuto Trait Implementations§
impl Freeze for KeyedRateLimiter
impl RefUnwindSafe for KeyedRateLimiter
impl Send for KeyedRateLimiter
impl Sync for KeyedRateLimiter
impl Unpin for KeyedRateLimiter
impl UnsafeUnpin for KeyedRateLimiter
impl UnwindSafe for KeyedRateLimiter
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