[][src]Trait governor::clock::Reference

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

A measurement from a clock.

Required methods

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

Determines the time that separates two measurements of a clock. Implementations of this must perform a saturating subtraction - if the earlier timestamp should be later, duration_since must return the zero duration.

fn saturating_sub(&self, duration: Nanos) -> Self[src]

Returns a reference point that lies at most duration in the past from the current reference. If an underflow should occur, returns the current reference.

Loading content...

Implementations on Foreign Types

impl Reference for Duration[src]

impl Reference for Instant[src]

impl Reference for SystemTime[src]

fn duration_since(&self, earlier: Self) -> Nanos[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).

Loading content...

Implementors

impl Reference for QuantaInstant[src]

Loading content...