pub enum RateLimitDecision {
Allow,
Deny {
retry_after_secs: u64,
limit: u32,
window_secs: u64,
},
}Expand description
Outcome of a single RateLimiter::check.
Variants§
Allow
Request is permitted. The hit was recorded.
Deny
Request exceeds the configured quota for this key. Caller
SHOULD return 429 Too Many Requests with a Retry-After
header equal to retry_after_secs.
Trait Implementations§
Source§impl Clone for RateLimitDecision
impl Clone for RateLimitDecision
Source§fn clone(&self) -> RateLimitDecision
fn clone(&self) -> RateLimitDecision
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 moreSource§impl Debug for RateLimitDecision
impl Debug for RateLimitDecision
Source§impl PartialEq for RateLimitDecision
impl PartialEq for RateLimitDecision
Source§fn eq(&self, other: &RateLimitDecision) -> bool
fn eq(&self, other: &RateLimitDecision) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for RateLimitDecision
impl StructuralPartialEq for RateLimitDecision
Auto Trait Implementations§
impl Freeze for RateLimitDecision
impl RefUnwindSafe for RateLimitDecision
impl Send for RateLimitDecision
impl Sync for RateLimitDecision
impl Unpin for RateLimitDecision
impl UnsafeUnpin for RateLimitDecision
impl UnwindSafe for RateLimitDecision
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