Skip to main content

Clock

Trait Clock 

Source
pub trait Clock {
    // Required methods
    fn now(&self) -> Timestamp;
    fn quality(&self) -> SyncQuality;
    fn source(&self) -> ClockSource;
}
Expand description

A time source producing wall+monotonic Timestamps.

Object-safe; all implementations enforce REQ-CLK-001 by construction (mono passes through a process-wide floor). Two advisory accessors make cost and trust observable instead of guessed.

REQ-CLK-001, REQ-CLK-004.

Required Methods§

Source

fn now(&self) -> Timestamp

Current reading. t.mono never decreases across calls within a process, even if the underlying source regresses. REQ-CLK-001.

Source

fn quality(&self) -> SyncQuality

Advisory sync quality of the underlying source (G2 — a hint, never a guarantee). REQ-CLK-004.

Source

fn source(&self) -> ClockSource

Which underlying source reads are actually served from. REQ-CLK-003.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§