pub trait Clock: Send + Sync {
// Required method
fn now(&self) -> SystemTime;
}Expand description
Supplies wall-clock time without making core services read the system clock.
Production runtimes can implement this trait with SystemTime::now, while
tests use a fixed or manually advanced clock.
Required Methods§
Sourcefn now(&self) -> SystemTime
fn now(&self) -> SystemTime
Returns the current wall-clock time.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".