Skip to main content

Clock

Trait Clock 

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

Source of the current time.

Used for cache staleness, verdict expiry and lockfile timestamps, so tests can control time.

Required Methods§

Source

fn now(&self) -> SystemTime

The current wall-clock time.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§