pub trait Clock: Send + Sync {
// Required method
fn now_millis(&self) -> i64;
}Expand description
A source of the current time.
The succession rules and the lease clock take an instant as a parameter, so
they need no clock at all. This trait is the seam for the code around them
that reads a real clock. A test supplies TestClock and drives time by
hand, with no sleep.
Required Methods§
Sourcefn now_millis(&self) -> i64
fn now_millis(&self) -> i64
The current time, in milliseconds since the Unix epoch.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".