Skip to main content

Time

Trait Time 

Source
pub trait Time {
    type Frequency: Frequency;
    type Ticks: Ticks;

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

Represents a moment in time, obtained by calling now.

Required Associated Types§

Source

type Frequency: Frequency

The number of ticks per second

Source

type Ticks: Ticks

The width of a time value

Required Methods§

Source

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

Returns a timestamp. Depending on the implementation of Time, this could represent either a static timestamp or a sample of a counter; if an implementation relies on it being constant or changing it should use Timestamp or Counter.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§