Skip to main content

TimeSource

Trait TimeSource 

Source
pub trait TimeSource {
    // Required methods
    fn now_in_walltime(&self) -> SystemTime;
    fn now_in_monotonic(&self) -> Instant;
    fn now(&self) -> ComplexTime;
}
Expand description

TimeSource is a trait for providing access to both the “System” (aka “Wall”) time for platform, as well as its monotonic time.

Required Methods§

Source

fn now_in_walltime(&self) -> SystemTime

Returns the current wall time.

Source

fn now_in_monotonic(&self) -> Instant

Returns the current montonic time.

Source

fn now(&self) -> ComplexTime

Returns the current ComplexTime (both wall and monotonic times).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> TimeSource for &T
where T: TimeSource,

Implementors§