pub struct CrdtMeta {
pub timestamp: HlcTimestamp,
pub node_id: NodeId,
}Expand description
Per-entry CRDT metadata for LWW (Last-Writer-Wins) conflict resolution.
20 bytes on wire: entry_kind (1B) + padding (3B) + HLC timestamp (12B) + NodeId (8B).
Conflict resolution: higher timestamp wins, NodeId tiebreaker. This forms a join-semilattice with a total order, guaranteeing:
- Commutativity: merge(a, b) == merge(b, a)
- Associativity: merge(merge(a, b), c) == merge(a, merge(b, c))
- Idempotency: merge(a, a) == a
Fields§
§timestamp: HlcTimestamp§node_id: NodeIdImplementations§
Trait Implementations§
impl Copy for CrdtMeta
impl Eq for CrdtMeta
impl StructuralPartialEq for CrdtMeta
Auto Trait Implementations§
impl Freeze for CrdtMeta
impl RefUnwindSafe for CrdtMeta
impl Send for CrdtMeta
impl Sync for CrdtMeta
impl Unpin for CrdtMeta
impl UnsafeUnpin for CrdtMeta
impl UnwindSafe for CrdtMeta
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