pub struct NoRateLimit;Expand description
A no-op rate-limit store. Every check returns Allow; every
record_failure and clear_failures is a no-op.
Trait Implementations§
Source§impl Clone for NoRateLimit
impl Clone for NoRateLimit
Source§fn clone(&self) -> NoRateLimit
fn clone(&self) -> NoRateLimit
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 moreimpl Copy for NoRateLimit
Source§impl Debug for NoRateLimit
impl Debug for NoRateLimit
Source§impl Default for NoRateLimit
impl Default for NoRateLimit
Source§fn default() -> NoRateLimit
fn default() -> NoRateLimit
Returns the “default value” for a type. Read more
Source§impl RateLimitStore for NoRateLimit
impl RateLimitStore for NoRateLimit
Source§async fn check(
&self,
_key: &RateLimitKey,
_policy: &RateLimitPolicy,
) -> Result<RateLimitOutcome, StoreError>
async fn check( &self, _key: &RateLimitKey, _policy: &RateLimitPolicy, ) -> Result<RateLimitOutcome, StoreError>
Check whether the key is within the policy limit before an
operation. Does not mutate state.
Source§async fn record_failure(
&self,
_key: &RateLimitKey,
_policy: &RateLimitPolicy,
) -> Result<(), StoreError>
async fn record_failure( &self, _key: &RateLimitKey, _policy: &RateLimitPolicy, ) -> Result<(), StoreError>
Record a failure for the given key within the current window.
Source§async fn clear_failures(&self, _key: &RateLimitKey) -> Result<(), StoreError>
async fn clear_failures(&self, _key: &RateLimitKey) -> Result<(), StoreError>
Clear all failure counters for the given key (called after a
successful redemption so legitimate users are not locked out).
Auto Trait Implementations§
impl Freeze for NoRateLimit
impl RefUnwindSafe for NoRateLimit
impl Send for NoRateLimit
impl Sync for NoRateLimit
impl Unpin for NoRateLimit
impl UnsafeUnpin for NoRateLimit
impl UnwindSafe for NoRateLimit
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