pub trait Clock: Send + Sync {
// Required methods
fn now(&self) -> Duration;
fn advance(&self, duration: Duration);
// Provided method
fn elapsed(&self, since: Duration) -> Duration { ... }
}Expand description
Trait for monotonic time in protocol execution.
Time is measured as a monotonic offset from an arbitrary epoch. This trait is synchronous; async extensions are provided by downstream crates.