Trait SystemTimeExt

Source
pub trait SystemTimeExt {
    // Required methods
    fn epoch(&self) -> Duration;
    fn epoch_millis(&self) -> u64;
}
Expand description

Extension trait to add methods to std::time::SystemTime

Required Methods§

Source

fn epoch(&self) -> Duration

Returns the duration since the Unix epoch.

Panics if the system time is before the Unix epoch.

Source

fn epoch_millis(&self) -> u64

Returns the number of milliseconds (rounded down) since the Unix epoch.

Panics if the system time is before the Unix epoch. Saturates at u64::MAX.

Implementations on Foreign Types§

Source§

impl SystemTimeExt for SystemTime

Implementors§