Skip to main content

StreamClock

Trait StreamClock 

Source
pub trait StreamClock: Send + Sync {
    // Required method
    fn now(&self) -> Duration;
}
Expand description

Monotonic time source for client stream measurements.

Implementations must return nondecreasing elapsed times from a fixed origin. A custom clock permits deterministic measurements in embedded environments and contract tests; normal gateways use Instant.

Required Methods§

Source

fn now(&self) -> Duration

Elapsed time from this clock’s fixed origin.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§