pub trait Clock:
Send
+ Sync
+ 'static {
// Required method
fn now(&self) -> DateTime<Utc>;
}Expand description
A source of the current time.
The guard never calls Utc::now directly, so tests (and simulations) can drive time with
ManualClock. Any Fn() -> DateTime<Utc> closure is also a clock.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".