pub trait Clock {
// Required methods
fn instant_now(&self) -> Instant;
fn system_now(&self) -> SystemTime;
}Expand description
Abstraction over the two clocks the pause module reads from. The
snapshot/restore path samples both Instant::now() and
SystemTime::now() to bridge monotonic deadlines and on-disk epoch
timestamps. Tests can substitute a FakeClock that advances both in
lockstep so assertions don’t need ±slack.
Required Methods§
fn instant_now(&self) -> Instant
fn system_now(&self) -> SystemTime
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".