pub struct ThrottleResult {
pub throttled: bool,
pub limit: u64,
pub remaining: u64,
pub reset_after: Duration,
pub retry_after: Option<Duration>,
}Fields§
§throttled: booltrue if the action was limited
limit: u64The total limit of the key (max_burst + 1). This is equivalent to the common X-RateLimit-Limit HTTP header.
remaining: u64The remaining limit of the key. Equivalent to X-RateLimit-Remaining.
reset_after: DurationThe 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