pub trait ClockAlg {
type Moment;
// Required methods
fn now(&self) -> Self::Moment;
fn since(&self, moment: &Self::Moment) -> Duration;
}Expand description
Specifies reading the passage of time.
Time is read rather than taken, so how long a run has been running is a statement about a clock the interpreter supplies and not about the one this machine happens to have.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".