[][src]Trait ratelimit_meter::instant::Relative

pub trait Relative: Sized + Sub<Duration, Output = Self> + Add<Duration, Output = Self> + PartialEq + Eq + Ord + Copy + Clone + Send + Sync + Debug {
    fn duration_since(&self, earlier: Self) -> Duration;
}

A point in time that is used as a reference for measuring a rate limit. On the clock, it has meaning only relative to some other point in time.

When using no_std, users of this crate are expected to provide an impl of Relative that corresponds to their system's time source.

Required methods

fn duration_since(&self, earlier: Self) -> Duration

Returns the amount of time elapsed from an earlier point in time.

Loading content...

Implementations on Foreign Types

impl Relative for Instant[src]

impl Relative for SystemTime[src]

fn duration_since(&self, earlier: Self) -> Duration[src]

Returns the difference in times between the two SystemTimes. Due to the fallible nature of SystemTimes, returns the zero duration if a negative duration would result (e.g. due to system clock adjustments).

impl Relative for Duration[src]

Loading content...

Implementors

impl Relative for Always[src]

Loading content...