Trait TimeFunctions

Source
pub trait TimeFunctions {
    type InstantType: Add<Duration, Output = Self::InstantType> + AddAssign<Duration> + Sub<Duration, Output = Self::InstantType> + SubAssign<Duration> + Sub<Self::InstantType, Output = Duration> + Ord + Copy;

    // Required method
    fn current_time() -> Self::InstantType;
}
Expand description

Functions to interact with system time.

Required Associated Types§

Source

type InstantType: Add<Duration, Output = Self::InstantType> + AddAssign<Duration> + Sub<Duration, Output = Self::InstantType> + SubAssign<Duration> + Sub<Self::InstantType, Output = Duration> + Ord + Copy

The type of an instant for this system. Analog for std::time::Instant.

Required Methods§

Source

fn current_time() -> Self::InstantType

Get the current instant. Analog for std::time::Instant::now.

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§