pub struct LWWRegister<T: Ord + Clone, K: Ord + Clone> { /* private fields */ }Expand description
A Last-Write-Wins Register CRDT
Stores a value along with a timestamp and replica ID. The value with the highest timestamp (tie-break on replica_id) always wins.
Implementations§
Trait Implementations§
Source§impl<T: Clone + Ord + Clone, K: Clone + Ord + Clone> Clone for LWWRegister<T, K>
impl<T: Clone + Ord + Clone, K: Clone + Ord + Clone> Clone for LWWRegister<T, K>
Source§fn clone(&self) -> LWWRegister<T, K>
fn clone(&self) -> LWWRegister<T, K>
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<'de, T, K> Deserialize<'de> for LWWRegister<T, K>
impl<'de, T, K> Deserialize<'de> for LWWRegister<T, K>
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
Source§impl<T: Ord + Clone, K: Ord + Clone + Default> Lattice for LWWRegister<T, K>
impl<T: Ord + Clone, K: Ord + Clone + Default> Lattice for LWWRegister<T, K>
Source§fn join(&self, other: &Self) -> Self
fn join(&self, other: &Self) -> Self
Join operation: keep the value with the highest timestamp Tie-break on replica_id (higher wins), then on value (higher wins)
Source§fn partial_cmp_lattice(&self, other: &Self) -> Option<Ordering>
fn partial_cmp_lattice(&self, other: &Self) -> Option<Ordering>
Partial order derived from join: a ≤ b iff a ⊔ b = b
Source§fn join_assign(&mut self, other: &Self)
fn join_assign(&mut self, other: &Self)
Join-assign: self = self ⊔ other
Source§impl<T, K> Serialize for LWWRegister<T, K>
impl<T, K> Serialize for LWWRegister<T, K>
impl<T: Eq + Ord + Clone, K: Eq + Ord + Clone> Eq for LWWRegister<T, K>
impl<T: Ord + Clone, K: Ord + Clone> StructuralPartialEq for LWWRegister<T, K>
Auto Trait Implementations§
impl<T, K> Freeze for LWWRegister<T, K>
impl<T, K> RefUnwindSafe for LWWRegister<T, K>where
K: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, K> Send for LWWRegister<T, K>
impl<T, K> Sync for LWWRegister<T, K>
impl<T, K> Unpin for LWWRegister<T, K>
impl<T, K> UnwindSafe for LWWRegister<T, K>where
K: UnwindSafe,
T: UnwindSafe,
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