DeltaCRDT

Trait DeltaCRDT 

Source
pub trait DeltaCRDT: Lattice {
    type Delta: Lattice;

    // Required methods
    fn split_delta(&mut self) -> Option<Self::Delta>;
    fn apply_delta(&mut self, delta: &Self::Delta);
}
Expand description

Marker trait for CRDTs that support delta operations

Required Associated Types§

Source

type Delta: Lattice

The delta state type (often the same as Self)

Required Methods§

Source

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)

Apply a delta to the state

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§