pub trait Clock: Send + Sync {
// Required method
fn now(&self) -> SystemTime;
}Expand description
The time source. Injectable so grant expiry and poll pacing are testable without sleeping;
production hosts use SystemClock.
Required Methods§
Sourcefn now(&self) -> SystemTime
fn now(&self) -> SystemTime
The current instant.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".