pub trait Clock:
Send
+ Sync
+ 'static {
// Required methods
fn wall_ms(&self) -> i64;
fn elapsed(&self) -> Duration;
// Provided method
fn elapsed_ms(&self) -> i64 { ... }
}Expand description
Separates wall timestamps from monotonic elapsed time.
Wall time stamps frames and invalidation markers. Elapsed time governs
deadlines and process-local expiry. Timers live on the Runtime.
Required Methods§
Provided Methods§
Sourcefn elapsed_ms(&self) -> i64
fn elapsed_ms(&self) -> i64
Whole-millisecond elapsed reading used by process-local storage.
Insertion and lookup share this integer grid, so an entry inserted at 0.7 ms with a 1,000 ms TTL expires when this reading reaches 1,000.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".