Trait PosixClock

Source
pub trait PosixClock: Default {
    const CLOCK_ID: clockid_t;

    // Provided methods
    fn now_raw() -> timespec { ... }
    fn resolution_raw() -> timespec { ... }
    fn resolution() -> Duration { ... }
}
Expand description

Functionality shared by all POSIX-compliant high-resolution clocks

Required Associated Constants§

Source

const CLOCK_ID: clockid_t

Which clock are we talking about?

Provided Methods§

Source

fn now_raw() -> timespec

Read the current value of this clock, in POSIX format

Source

fn resolution_raw() -> timespec

Check the resolution (precision) of this clock, in POSIX format

Source

fn resolution() -> Duration

Check the resolution (precision) of this clock, in this crate’s format

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§