Skip to main content

Crdt

Trait Crdt 

Source
pub trait Crdt: Mergeable {
    type Delta;

    // Required method
    fn apply_delta(&mut self, delta: Self::Delta);

    // Provided methods
    fn replica_count(&self) -> Option<usize> { ... }
    fn validate_record(
        &self,
        _id: RecordId,
        _delta: &Self::Delta,
    ) -> Result<(), WireError> { ... }
}
Expand description

Delta application surface for CRDT product types.

Required Associated Types§

Required Methods§

Source

fn apply_delta(&mut self, delta: Self::Delta)

Provided Methods§

Source

fn replica_count(&self) -> Option<usize>

Fixed replica domain, or None for CRDTs without a fixed arity.

Source

fn validate_record( &self, _id: RecordId, _delta: &Self::Delta, ) -> Result<(), WireError>

Validate decoded records before admission or replay into this carrier.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Crdt for GCounter

Source§

impl Crdt for PnCounter

Source§

impl<K: Ord + Clone, V: Ord + Clone> Crdt for LwwMap<K, V>

Source§

impl<K: Ord + Clone> Crdt for EnableWinsFlag<K>

Source§

impl<P: Ord + Clone, V: Ord + Clone> Crdt for Rga<P, V>

Source§

type Delta = RgaDelta<P, V>

Source§

impl<T: Ord + Clone, K: Ord + Clone> Crdt for OrSet<T, K>

Source§

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

Source§

type Delta = T

Source§

impl<V: Ord + Clone> Crdt for LwwRegister<V>