pub trait Clock: Send + Sync {
// Required method
fn now(&self) -> Duration;
}Expand description
Monotonic time source for epoch measurements.
Returns time elapsed since an arbitrary per-clock origin. The production
implementation wraps std::time::Instant; tests use MockClock so
controller behavior is a pure function of the scripted inputs.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".