Skip to main content

Clock

Trait Clock 

Source
pub trait Clock: Send + Sync {
    // Required method
    fn now_ms(&self) -> u64;
}
Expand description

Injectable time source. Production code uses SystemClock; tests drive TTL expiry with FakeClock so they don’t depend on wall time.

Required Methods§

Source

fn now_ms(&self) -> u64

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§