Skip to main content

GatewayClock

Trait GatewayClock 

Source
pub trait GatewayClock {
    // Required method
    fn now_ms(&mut self) -> Result<u64>;
}
Expand description

Source of millisecond wall-clock timestamps for the gateway.

Abstracts time so production code can use the real system clock while tests use a reproducible deterministic clock.

Required Methods§

Source

fn now_ms(&mut self) -> Result<u64>

Returns the current time in milliseconds since the Unix epoch.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§