Skip to main content

Crate lww_register

Crate lww_register 

Source
Expand description

A small state-based last-write-wins register and Hybrid Logical Clock domain.

Entry<T, V> is the generic register state. LwwRegister<V> is the recommended alias using this crate’s Timestamp ordering. The crate intentionally contains no networking, membership, persistence, async runtime, storage codec, or wall-clock implementation.

§Convergence contract

Distinct conflicting writes must receive distinct stamps from one total order. With Timestamp, give every independently writing replica a distinct NodeId and use a Clock implementation that satisfies assert_conformance.

Re-exports§

pub use clock::assert_conformance;
pub use clock::AdmittedTime;
pub use clock::Clock;
pub use clock::ClockDrift;
pub use clock::Hlc;
pub use clock::LogicalCounter;
pub use clock::NodeId;
pub use clock::PhysicalTime;
pub use clock::Timestamp;
pub use clock::MAX_CLOCK_DRIFT;
pub use entry::Entry;
pub use entry::State;

Modules§

clock
Hybrid Logical Clock domain types.
entry
Last-write-wins register state.

Type Aliases§

LwwRegister
An LWW register using this crate’s Hybrid Logical Clock Timestamp as its stamp.