Clock

Trait Clock 

Source
pub trait Clock: Default {
    // Required method
    fn now(&self) -> Instant;
}
Expand description

Common interface shared by all Clocks provided by this library

Required Methods§

Source

fn now(&self) -> Instant

Get an Instant representing the current time

Instants should be above Instant::EPOCH and monotonically increasing, but low-quality clocks may slow down and speed up slightly as they try to synchronize themselves with other clocks. Good timestamp clocks will prevent this and always deliver 100% steady time.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§