pub struct Timestamp { /* private fields */ }Expand description
HLC timestamp — packs (wall_ms: 48, counter: 16) into a single u64.
This is the canonical in-memory and on-wire representation of a
LogEntry.timestamp value. Plain numeric comparison on the raw u64
preserves causal order (wall dominates, counter tie-breaks).
Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub fn from_parts(millis: u64, counter: u16) -> Self
pub fn from_parts(millis: u64, counter: u16) -> Self
Compose from (millis, counter) parts. millis must fit in the top
48 bits — Unix-epoch ms stays under 2^48 until roughly year 10895.
A larger value would shift its high bits off the top of the u64
(<< discards them rather than panicking) and silently wrap the wall
component back toward zero, shattering monotonicity — so we panic
instead. Unreachable for any real timestamp.
Trait Implementations§
impl Copy for Timestamp
impl Eq for Timestamp
Source§impl Ord for Timestamp
impl Ord for Timestamp
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 Timestamp
impl PartialOrd for Timestamp
impl StructuralPartialEq for Timestamp
Auto Trait Implementations§
impl Freeze for Timestamp
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnsafeUnpin for Timestamp
impl UnwindSafe for Timestamp
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