Skip to main content

TimeDuration

Trait TimeDuration 

Source
pub trait TimeDuration:
    Copy
    + PartialEq
    + 'static {
    const ZERO: Self;

    // Required methods
    fn as_millis(&self) -> u64;
    fn from_millis(millis: u64) -> Self;
    fn saturating_sub(self, other: Self) -> Self;
}
Expand description

Abstraction for a duration of time.

Required Associated Constants§

Source

const ZERO: Self

Required Methods§

Source

fn as_millis(&self) -> u64

Source

fn from_millis(millis: u64) -> Self

Source

fn saturating_sub(self, other: Self) -> Self

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§