pub struct ORSet<T: Ord + Clone> { /* private fields */ }Expand description
An Observed-Remove Set (OR-Set) CRDT with add-wins semantics.
Each insertion is tagged with a globally unique Tag. A remove operation
only removes the tags that were observed at the time of removal. This means
a concurrent add and remove results in the element being present (add wins).
Supports delta-state replication via the DeltaCRDT trait.
Implementations§
Trait Implementations§
Source§impl<T: Ord + Clone> DeltaCRDT for ORSet<T>
impl<T: Ord + Clone> DeltaCRDT for ORSet<T>
Source§type Delta = ORSetDelta<T>
type Delta = ORSetDelta<T>
The delta state type (often the same as Self)
Source§fn split_delta(&mut self) -> Option<Self::Delta>
fn split_delta(&mut self) -> Option<Self::Delta>
Split off pending deltas, returning them and resetting internal delta buffer
Source§fn apply_delta(&mut self, delta: &Self::Delta)
fn apply_delta(&mut self, delta: &Self::Delta)
Apply a delta to the state
Source§impl<'de, T> Deserialize<'de> for ORSet<T>
impl<'de, T> Deserialize<'de> for ORSet<T>
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> Lattice for ORSet<T>
impl<T: Ord + Clone> Lattice for ORSet<T>
Source§fn join(&self, other: &Self) -> Self
fn join(&self, other: &Self) -> Self
Join operation (least upper bound)
Must be commutative, associative, and idempotent
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
impl<T: Eq + Ord + Clone> Eq for ORSet<T>
impl<T: Ord + Clone> StructuralPartialEq for ORSet<T>
Auto Trait Implementations§
impl<T> Freeze for ORSet<T>
impl<T> RefUnwindSafe for ORSet<T>where
T: RefUnwindSafe,
impl<T> Send for ORSet<T>where
T: Send,
impl<T> Sync for ORSet<T>where
T: Sync,
impl<T> Unpin for ORSet<T>
impl<T> UnwindSafe for ORSet<T>where
T: RefUnwindSafe,
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