Skip to main content

MonotonicClockExt

Trait MonotonicClockExt 

Source
pub trait MonotonicClockExt {
    type Instant;

    // Required methods
    fn now_with(&self, precision: Duration) -> Self::Instant;
    fn resolution(&self) -> Duration;
}
Expand description

Extension trait for cap_std::time::MonotonicClock.

Required Associated Types§

Source

type Instant

A monotonic clock datapoint.

Required Methods§

Source

fn now_with(&self, precision: Duration) -> Self::Instant

Similar to MonotonicClock::now, but takes an additional precision parameter allowing callers to inform the implementation when they don’t need full precision. The implementation need not make any effort to provide a time with greater precision.

Source

fn resolution(&self) -> Duration

Return the resolution of the clock.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl MonotonicClockExt for MonotonicClock

Available on non-Windows only.
Source§

type Instant = Instant

Source§

fn now_with(&self, _precision: Duration) -> Self::Instant

Source§

fn resolution(&self) -> Duration

Implementors§