pub trait Clock: Send + Sync {
// Required method
fn now(&self) -> SystemTime;
}Expand description
Supplies instants to repository and runtime operations.
Implementations must be thread-safe. Test clocks should return controlled instants rather than consulting wall-clock time.
Required Methods§
Sourcefn now(&self) -> SystemTime
fn now(&self) -> SystemTime
Returns the current instant.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".