pub struct EventClock {
pub physical: u64,
pub logical: u32,
}Expand description
An HlcTimestamp as it is stored on an event.
HlcTimestamp carries no serde derives, so this mirrors its two fields.
It serializes as {"physical": <ns>, "logical": <n>}, and orders exactly as
the underlying timestamp does: by wall-clock nanoseconds first, then by the
logical counter that breaks ties within the same nanosecond.
Fields§
§physical: u64Wall-clock component: nanoseconds since the Unix epoch.
logical: u32Logical counter, distinguishing events within one nanosecond.
Implementations§
Source§impl EventClock
impl EventClock
Sourcepub fn happened_before(self, other: Self) -> bool
pub fn happened_before(self, other: Self) -> bool
Whether self was recorded before other.
Trait Implementations§
Source§impl Clone for EventClock
impl Clone for EventClock
impl Copy for EventClock
Source§impl Debug for EventClock
impl Debug for EventClock
Source§impl<'de> Deserialize<'de> for EventClock
impl<'de> Deserialize<'de> for EventClock
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
impl Eq for EventClock
Source§impl From<EventClock> for HlcTimestamp
impl From<EventClock> for HlcTimestamp
Source§fn from(clock: EventClock) -> Self
fn from(clock: EventClock) -> Self
Converts to this type from the input type.
Source§impl From<HlcTimestamp> for EventClock
impl From<HlcTimestamp> for EventClock
Source§fn from(ts: HlcTimestamp) -> Self
fn from(ts: HlcTimestamp) -> Self
Converts to this type from the input type.
Source§impl Hash for EventClock
impl Hash for EventClock
Source§impl Ord for EventClock
impl Ord for EventClock
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 PartialEq for EventClock
impl PartialEq for EventClock
Source§impl PartialOrd for EventClock
impl PartialOrd for EventClock
Source§impl Serialize for EventClock
impl Serialize for EventClock
impl StructuralPartialEq for EventClock
Auto Trait Implementations§
impl Forget for EventClock
impl Freeze for EventClock
impl Move for EventClock
impl RefUnwindSafe for EventClock
impl Send for EventClock
impl Sync for EventClock
impl Unpin for EventClock
impl UnsafeUnpin for EventClock
impl UnwindSafe for EventClock
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