Lattice

Trait Lattice 

Source
pub trait Lattice: Clone + PartialEq {
    // Required methods
    fn bottom() -> Self;
    fn join(&self, other: &Self) -> Self;

    // Provided methods
    fn partial_cmp_lattice(&self, other: &Self) -> Option<Ordering> { ... }
    fn leq(&self, other: &Self) -> bool { ... }
    fn join_assign(&mut self, other: &Self) { ... }
}
Expand description

The core CRDT trait. All state-based CRDTs implement this.

Required Methods§

Source

fn bottom() -> Self

The bottom element (identity for join)

Source

fn join(&self, other: &Self) -> Self

Join operation (least upper bound) Must be commutative, associative, and idempotent

Provided Methods§

Source

fn partial_cmp_lattice(&self, other: &Self) -> Option<Ordering>

Partial order derived from join: a ≤ b iff a ⊔ b = b

Source

fn leq(&self, other: &Self) -> bool

Check if self ≤ other in the lattice order

Source

fn join_assign(&mut self, other: &Self)

Join-assign: self = self ⊔ other

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<K: Ord + Clone> Lattice for CRDTMap<K>

Source§

impl<K: Ord + Clone> Lattice for PNCounter<K>

Source§

impl<T: Ord + Clone> Lattice for GSet<T>

Source§

impl<T: Ord + Clone> Lattice for MVRegister<T>

Source§

impl<T: Ord + Clone> Lattice for ORSet<T>

Source§

impl<T: Ord + Clone> Lattice for ORSetDelta<T>

Source§

impl<T: Ord + Clone, K: Ord + Clone + Default> Lattice for LWWRegister<T, K>