Struct ratelimit_meter::algorithms::leaky_bucket::TooEarly
source · pub struct TooEarly(_, _);
Expand description
Returned in case of a negative rate-limiting decision.
To avoid the thundering herd effect, client code should always add some jitter to the wait time.
Trait Implementations
sourceimpl Fail for TooEarly
impl Fail for TooEarly
sourcefn cause(&self) -> Option<&dyn Fail>
fn cause(&self) -> Option<&dyn Fail>
Returns a reference to the underlying cause of this failure, if it
is an error that wraps other errors. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
Returns a reference to the
Backtrace
carried by this failure, if it
carries one. Read moresourceimpl NonConformance for TooEarly
impl NonConformance for TooEarly
sourcefn earliest_possible(&self) -> Instant
fn earliest_possible(&self) -> Instant
Returns the earliest time at which a decision could be
conforming (excluding conforming decisions made by the Decider
that are made in the meantime). Read more
sourcefn wait_time_from(&self, from: Instant) -> Duration
fn wait_time_from(&self, from: Instant) -> Duration
Returns the minimum amount of time from the time that the
decision was made (relative to the
at
argument in a
Decider
’s check_at
method) that must pass before a
decision can be conforming. Since Durations can not be
negative, a zero duration is returned if from
is already
after that duration. Read moreimpl StructuralPartialEq for TooEarly
Auto Trait Implementations
impl RefUnwindSafe for TooEarly
impl Send for TooEarly
impl Sync for TooEarly
impl Unpin for TooEarly
impl UnwindSafe for TooEarly
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more