Skip to main content

StampClock

Trait StampClock 

Source
pub trait StampClock: Send + 'static {
    type Instant: Instant;

    // Required method
    fn now(&self) -> Self::Instant;
}
Expand description

A clock whose readings never decrease, read once per stamped transition.

Implementing it is the implementor’s statement of that promise; the core does not check it. A clock that goes backwards yields stamps out of order, which the conformance oracle reports when a test gives it the entries.

Required Associated Types§

Source

type Instant: Instant

What a reading is.

Required Methods§

Source

fn now(&self) -> Self::Instant

A reading: never before one taken earlier.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§