Skip to main content

Clock

Trait Clock 

Source
pub trait Clock:
    Send
    + Sync
    + 'static {
    // Required method
    fn now(&self) -> Duration;
}
Expand description

Supplies monotonic elapsed time to a MemoryStore.

A clock implementation must never intentionally move backwards. The store nevertheless clamps values to the greatest time observed by each touched shard, which also makes deterministic test clocks straightforward.

Required Methods§

Source

fn now(&self) -> Duration

Returns monotonic time elapsed from an arbitrary origin.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§