Skip to main content

Clock

Trait Clock 

Source
pub trait Clock:
    Send
    + Sync
    + Debug {
    // Required method
    fn now(&self) -> DateTime<Utc>;
}
Expand description

Source of the current time for a store.

Implementations must be cheap and must never block: a store calls Clock::now while it holds its internal lock.

Required Methods§

Source

fn now(&self) -> DateTime<Utc>

The current instant, in UTC.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§