Skip to main content

Clock

Trait Clock 

Source
pub trait Clock {
    // Required method
    fn now_unix(&self) -> u64;
}
Expand description

Supplies the current time. Injected so time-dependent logic (journal timestamps, run ages) is deterministic under test.

Required Methods§

Source

fn now_unix(&self) -> u64

Current time as whole seconds since the Unix epoch.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§