Struct base::cross_process_instant::CrossProcessInstant
source · pub struct CrossProcessInstant {
value: u64,
}
Expand description
A monotonic, nanosecond precision timer that can be used cross-process. The value
stored internally is purposefully opaque as the origin is platform-specific. They can
be compared and time_03::Duration
can be found by subtracting one from another.
The time
crate is used in this case instead of std::time
so that durations can
be negative.
Fields§
§value: u64
Implementations§
source§impl CrossProcessInstant
impl CrossProcessInstant
pub fn now() -> Self
sourcepub fn epoch() -> Self
pub fn epoch() -> Self
Some unspecified time epoch. This is mainly useful for converting DOM’s timeOrigin
into a
DOMHighResolutionTimestamp
. See https://w3c.github.io/hr-time/#sec-time-origin.
Trait Implementations§
source§impl Add<Duration> for CrossProcessInstant
impl Add<Duration> for CrossProcessInstant
source§impl Clone for CrossProcessInstant
impl Clone for CrossProcessInstant
source§fn clone(&self) -> CrossProcessInstant
fn clone(&self) -> CrossProcessInstant
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CrossProcessInstant
impl Debug for CrossProcessInstant
source§impl<'de> Deserialize<'de> for CrossProcessInstant
impl<'de> Deserialize<'de> for CrossProcessInstant
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl MallocSizeOf for CrossProcessInstant
impl MallocSizeOf for CrossProcessInstant
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
source§impl Ord for CrossProcessInstant
impl Ord for CrossProcessInstant
source§fn cmp(&self, other: &CrossProcessInstant) -> Ordering
fn cmp(&self, other: &CrossProcessInstant) -> Ordering
1.21.0 · 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 PartialEq for CrossProcessInstant
impl PartialEq for CrossProcessInstant
source§fn eq(&self, other: &CrossProcessInstant) -> bool
fn eq(&self, other: &CrossProcessInstant) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for CrossProcessInstant
impl PartialOrd for CrossProcessInstant
source§fn partial_cmp(&self, other: &CrossProcessInstant) -> Option<Ordering>
fn partial_cmp(&self, other: &CrossProcessInstant) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for CrossProcessInstant
impl Serialize for CrossProcessInstant
source§impl Sub<Duration> for CrossProcessInstant
impl Sub<Duration> for CrossProcessInstant
source§impl Sub for CrossProcessInstant
impl Sub for CrossProcessInstant
impl Copy for CrossProcessInstant
impl Eq for CrossProcessInstant
impl StructuralPartialEq for CrossProcessInstant
Auto Trait Implementations§
impl Freeze for CrossProcessInstant
impl RefUnwindSafe for CrossProcessInstant
impl Send for CrossProcessInstant
impl Sync for CrossProcessInstant
impl Unpin for CrossProcessInstant
impl UnwindSafe for CrossProcessInstant
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
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.