Trait Duration

Source
pub trait Duration:
    Clone
    + Copy
    + AddAssign
    + PartialOrd {
    // Required methods
    fn zero() -> Self;
    fn from_micros(micros: u64) -> Self;
    fn is_zero(&self) -> bool;
    fn div_duration_f64(self, rhs: Self) -> f64;
}

Required Methods§

Source

fn zero() -> Self

Creates a new duration, spanning no time.

Source

fn from_micros(micros: u64) -> Self

Creates a new duration from the specified number of microseconds.

Source

fn is_zero(&self) -> bool

Returns true if this duration spans no time.

Source

fn div_duration_f64(self, rhs: Self) -> f64

Divide this duration by another Duration and return f64.

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.

Implementations on Foreign Types§

Source§

impl Duration for Duration

Source§

fn zero() -> Self

Source§

fn from_micros(micros: u64) -> Self

Source§

fn is_zero(&self) -> bool

Source§

fn div_duration_f64(self, rhs: Self) -> f64

Implementors§