pub struct MonotonicTime { /* private fields */ }Expand description
An instant in monotonic time as provided by a CLOCK_MONOTONIC like clock
Internally, this uses microsecond (micros) sized values to track, giving 584942417355.07202148 years until overflow. Internally, systemd uses the same layout for it’s time values.
Implementations§
Source§impl MonotonicTime
impl MonotonicTime
pub const ZERO: Self
Sourcepub const fn from_micros(micros: u64) -> Self
pub const fn from_micros(micros: u64) -> Self
Create a timestamp from microseconds
pub const fn from_millis(millis: u64) -> Self
pub const fn from_seconds(seconds: u32) -> Self
Source§impl MonotonicTime
impl MonotonicTime
Sourcepub fn to_core_duration(self) -> Duration
pub fn to_core_duration(self) -> Duration
Treat a MonotonicTime as if it were a core::time::Duration
Sometimes, due to the lack of a way to generate a std::time::Instant from a numeric
value, other code may use a Duration to contain a timestamp. This creates such a
duration.
Sourcepub fn from_core_duration(ctd: Duration) -> Self
pub fn from_core_duration(ctd: Duration) -> Self
Treat a duration as if it instead was a timestamp.
Sometimes, due to the lack of a way to generate a std::time::Instant from a numeric
value, other code may use a Duration to contain a timestamp. In that case, you should
use this function to obtain a MonotonicTime for the timestamp within the Duration
Trait Implementations§
Source§impl Add<Duration> for MonotonicTime
impl Add<Duration> for MonotonicTime
Source§impl Add<Duration> for MonotonicTime
impl Add<Duration> for MonotonicTime
Source§impl Clone for MonotonicTime
impl Clone for MonotonicTime
Source§fn clone(&self) -> MonotonicTime
fn clone(&self) -> MonotonicTime
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more