[][src]Trait ratelimit_meter::algorithms::NonConformance

pub trait NonConformance<P: Reference = <DefaultClock as Clock>::Instant> {
    fn earliest_possible(&self) -> P;

    fn wait_time_from(&self, from: P) -> Duration { ... }
}

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.

Required methods

fn earliest_possible(&self) -> P

Returns the earliest time at which a decision could be conforming (excluding conforming decisions made by the Decider that are made in the meantime).

Loading content...

Provided methods

fn wait_time_from(&self, from: P) -> 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.

Loading content...

Implementors

impl<P: Reference> NonConformance<P> for NotUntil<P>[src]

impl<P: Reference> NonConformance<P> for TooEarly<P>[src]

Loading content...