Skip to main content

Clock

Trait Clock 

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

A deterministic source of evaluation time supplied by the caller.

Implementations may use synchronization primitives when they need mutable state, but the provider is owned by the specification that receives it. There is no ambient or global clock.

Required Methods§

Source

fn now(&self) -> Duration

Returns the current time in the clock’s chosen monotonic epoch.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§