pub struct Mono(/* private fields */);Expand description
A monotonic instant: nanoseconds since the process clock origin.
Plain data replacement for std::time::Instant. Ordering and
arithmetic are exactly u64-ns ordering; the origin is arbitrary
(process start for the real clock, simulation start for a virtual
one) so only differences are meaningful.
Implementations§
Source§impl Mono
impl Mono
Sourcepub fn as_nanos(self) -> u64
pub fn as_nanos(self) -> u64
Nanoseconds since the clock origin. Exposed for logging and for simulators that want to inspect the raw timeline.
Sourcepub fn duration_since(self, earlier: Mono) -> Duration
pub fn duration_since(self, earlier: Mono) -> Duration
Duration from earlier to self, saturating to zero if
earlier is actually later (mirrors
Instant::saturating_duration_since).
Trait Implementations§
impl Copy for Mono
impl Eq for Mono
Source§impl Ord for Mono
impl Ord for Mono
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
Source§impl PartialOrd for Mono
impl PartialOrd for Mono
impl StructuralPartialEq for Mono
Auto Trait Implementations§
impl Freeze for Mono
impl RefUnwindSafe for Mono
impl Send for Mono
impl Sync for Mono
impl Unpin for Mono
impl UnsafeUnpin for Mono
impl UnwindSafe for Mono
Blanket Implementations§
impl<T> ArchiveOwner for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<S, T> IntoEncoded<S> for Twhere
S: Encodes<T>,
impl<S, T> IntoEncoded<S> for Twhere
S: Encodes<T>,
Source§fn into_encoded(self) -> <T as IntoEncoded<S>>::Output
fn into_encoded(self) -> <T as IntoEncoded<S>>::Output
Run the conversion.