Struct ratelimit_meter::NonConformance
source · pub struct NonConformance { /* private fields */ }
Expand description
Provides additional information about non-conforming cells, most importantly the earliest time until the next cell could be considered conforming.
Since this does not account for effects like thundering herds, users should always add random jitter to the times given.
Implementations
sourceimpl NonConformance
impl NonConformance
sourcepub fn earliest_possible(&self) -> Instant
pub 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).
sourcepub fn wait_time_from(&self, from: Instant) -> Duration
pub 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.
Trait Implementations
sourceimpl Debug for NonConformance
impl Debug for NonConformance
sourceimpl Display for NonConformance
impl Display for NonConformance
sourceimpl Fail for NonConformance
impl Fail for NonConformance
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 PartialEq<NonConformance> for NonConformance
impl PartialEq<NonConformance> for NonConformance
sourcefn eq(&self, other: &NonConformance) -> bool
fn eq(&self, other: &NonConformance) -> bool
impl StructuralPartialEq for NonConformance
Auto Trait Implementations
impl RefUnwindSafe for NonConformance
impl Send for NonConformance
impl Sync for NonConformance
impl Unpin for NonConformance
impl UnwindSafe for NonConformance
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