pub struct HybridTimestamp {
pub physical: u64,
pub logical: u16,
pub node_id: u16,
}Expand description
A timestamp from a Hybrid Logical Clock.
Consists of:
physical: milliseconds since Unix epoch (or any monotonic source)logical: counter for events within the same physical millisecondnode_id: tiebreaker to ensure total ordering across nodes (lower 16 bits ofNodeId)
Total size: 12 bytes (u64 + u16 + u16).
Note: node_id uses only 16 bits for compact timestamps. When
constructing from a NodeId (u64), only the lower 16 bits are used
for tiebreaking. This is sufficient for up to 65 535 concurrent nodes.
Fields§
§physical: u64Physical time component (milliseconds).
logical: u16Logical counter for same-millisecond ordering.
node_id: u16Node identifier for deterministic tiebreaking (lower 16 bits of NodeId).
Implementations§
Trait Implementations§
Source§impl Clone for HybridTimestamp
impl Clone for HybridTimestamp
Source§fn clone(&self) -> HybridTimestamp
fn clone(&self) -> HybridTimestamp
Returns a duplicate 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 HybridTimestamp
impl Debug for HybridTimestamp
Source§impl Hash for HybridTimestamp
impl Hash for HybridTimestamp
Source§impl Ord for HybridTimestamp
impl Ord for HybridTimestamp
Source§impl PartialEq for HybridTimestamp
impl PartialEq for HybridTimestamp
Source§impl PartialOrd for HybridTimestamp
impl PartialOrd for HybridTimestamp
impl Copy for HybridTimestamp
impl Eq for HybridTimestamp
impl StructuralPartialEq for HybridTimestamp
Auto Trait Implementations§
impl Freeze for HybridTimestamp
impl RefUnwindSafe for HybridTimestamp
impl Send for HybridTimestamp
impl Sync for HybridTimestamp
impl Unpin for HybridTimestamp
impl UnsafeUnpin for HybridTimestamp
impl UnwindSafe for HybridTimestamp
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