Skip to main content

ClockPort

Trait ClockPort 

Source
pub trait ClockPort: Send + Sync {
    // Required method
    fn now(&self) -> OffsetDateTime;

    // Provided method
    fn uptime(&self) -> DurationMs { ... }
}

Required Methods§

Provided Methods§

Source

fn uptime(&self) -> DurationMs

Monotonic time since the composition root created this clock. Deterministic test clocks default to a frozen zero uptime.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§