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

pub trait NonConformance {
    fn earliest_possible(&self) -> Instant;
fn wait_time_from(&self, from: Instant) -> Duration; fn wait_time(&self) -> 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

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

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.

Provided Methods

Returns the minimum amount of time (down to 0) that needs to pass from the current instant for the Decider to consider a cell conforming again.


impl NonConformance for NotUntil

impl NonConformance for TooEarly