pub struct Time(pub u64);Expand description
Engine time: nanoseconds since the engine epoch.
The engine only requires that time never goes backwards; it makes no assumption about where
the epoch is. The cronoq runtime uses the Unix epoch, so Time(n) is n nanoseconds after
1970-01-01T00:00:00Z (representable until the year 2554). Tests often use small values.
Tuple Fields§
§0: u64Implementations§
Source§impl Time
impl Time
Sourcepub fn from_secs_f64(s: f64) -> Time
pub fn from_secs_f64(s: f64) -> Time
Time from (fractional) seconds since the epoch; negative values clamp to zero.
Sourcepub fn as_secs_f64(self) -> f64
pub fn as_secs_f64(self) -> f64
Seconds since the epoch.
Sourcepub fn saturating_sub(self, other: Time) -> Duration
pub fn saturating_sub(self, other: Time) -> Duration
self - other, or zero if other is later.
Trait Implementations§
impl Copy for Time
impl Eq for Time
Source§impl Ord for Time
impl Ord for Time
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Time
impl PartialOrd for Time
impl StructuralPartialEq for Time
Auto Trait Implementations§
impl Freeze for Time
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnsafeUnpin for Time
impl UnwindSafe for Time
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more