Struct throttle::ThrottleResult
source · pub struct ThrottleResult {
pub throttled: bool,
pub limit: u64,
pub remaining: u64,
pub reset_after: Duration,
pub retry_after: Option<Duration>,
}
Fields§
§throttled: bool
true if the action was limited
limit: u64
The total limit of the key (max_burst + 1). This is equivalent to the common X-RateLimit-Limit HTTP header.
remaining: u64
The remaining limit of the key. Equivalent to X-RateLimit-Remaining.
reset_after: Duration
The number of seconds until the limit will reset to its maximum capacity. Equivalent to X-RateLimit-Reset.
retry_after: Option<Duration>
The number of seconds until the user should retry, but None if the action was allowed. Equivalent to Retry-After.
Trait Implementations§
source§impl Debug for ThrottleResult
impl Debug for ThrottleResult
source§impl PartialEq for ThrottleResult
impl PartialEq for ThrottleResult
source§impl Serialize for ThrottleResult
impl Serialize for ThrottleResult
impl Eq for ThrottleResult
impl StructuralPartialEq for ThrottleResult
Auto Trait Implementations§
impl Freeze for ThrottleResult
impl RefUnwindSafe for ThrottleResult
impl Send for ThrottleResult
impl Sync for ThrottleResult
impl Unpin for ThrottleResult
impl UnwindSafe for ThrottleResult
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more