pub struct RateLimit {
pub limit: u64,
pub used: u64,
pub remaining: u64,
pub reset_after: Duration,
pub exceeded: bool,
}Expand description
The outcome of one attempt, and everything the X-RateLimit-* headers need.
Fields§
§limit: u64The configured ceiling for the window.
used: u64How many attempts this key has made in the current window.
remaining: u64How many remain. Zero once the limit is reached.
reset_after: DurationHow long until the window resets — what Retry-After reports.
exceeded: boolWhether this attempt was refused.
Implementations§
Trait Implementations§
impl Eq for RateLimit
impl StructuralPartialEq for RateLimit
Auto Trait Implementations§
impl Freeze for RateLimit
impl RefUnwindSafe for RateLimit
impl Send for RateLimit
impl Sync for RateLimit
impl Unpin for RateLimit
impl UnsafeUnpin for RateLimit
impl UnwindSafe for RateLimit
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