pub struct WallBase { /* private fields */ }Expand description
A wall-clock reading in milliseconds since the epoch, paired with the monotonic instant it was taken at.
Implementations§
Source§impl WallBase
impl WallBase
Sourcepub fn now() -> Result<Self, ConsoleError>
pub fn now() -> Result<Self, ConsoleError>
Reads the wall clock now.
§Errors
Returns ConsoleError::Clock when the wall clock reads before the
epoch or past what milliseconds in a u64 can hold.
Sourcepub const fn fixed(unix_ms: u64, at: Instant) -> Self
pub const fn fixed(unix_ms: u64, at: Instant) -> Self
A base fixed at unix_ms for at, for records whose times must be
reproducible.
Sourcepub fn unix_ms_at(&self, seen_at: Instant) -> Result<u64, ConsoleError>
pub fn unix_ms_at(&self, seen_at: Instant) -> Result<u64, ConsoleError>
Wall time, in milliseconds since the epoch, of the monotonic instant
seen_at. An instant before the base reads as the base.
§Errors
Returns ConsoleError::Clock when the sum passes u64 milliseconds.
Sourcepub fn unix_ms_of(&self, at: Instant) -> Result<u64, ConsoleError>
pub fn unix_ms_of(&self, at: Instant) -> Result<u64, ConsoleError>
Wall time, in milliseconds since the epoch, of the monotonic instant
at, before or after the base.
§Errors
Returns ConsoleError::Clock when it falls outside u64
milliseconds.
Trait Implementations§
impl Copy for WallBase
impl Eq for WallBase
impl StructuralPartialEq for WallBase
Auto Trait Implementations§
impl Freeze for WallBase
impl RefUnwindSafe for WallBase
impl Send for WallBase
impl Sync for WallBase
impl Unpin for WallBase
impl UnsafeUnpin for WallBase
impl UnwindSafe for WallBase
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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.