Skip to main content

Clock

Trait Clock 

pub trait Clock: Send + Sync {
    // Required methods
    fn now_utc(&self) -> DateTime<Utc>;
    fn mono_ns(&self) -> u64;
}
Expand description

Injected clock — ensures deterministic replay by avoiding Utc::now().

Required Methods§

fn now_utc(&self) -> DateTime<Utc>

Current UTC wall-clock time.

fn mono_ns(&self) -> u64

Monotonic nanosecond counter (relative to run start).

Implementors§