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