pub trait Clock {
// Required method
fn unix_now(&self) -> u64;
// Provided method
fn unix_now_plus(&self, offset: Duration) -> u64 { ... }
}Expand description
A source of the current wall-clock time, expressed as seconds since the Unix epoch (UTC). Implementations must be infallible and must return a non-decreasing value in production.
Required Methods§
Provided Methods§
Sourcefn unix_now_plus(&self, offset: Duration) -> u64
fn unix_now_plus(&self, offset: Duration) -> u64
Convenience: current time plus offset.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".