[][src]Trait ron_crdt::crdt::CRDT

pub trait CRDT {
    type T;
    fn new<'a>(obj: UUID) -> Frame<'a>;
fn reduce<'a>(
        state: Frame<'a>,
        updates: Vec<Frame<'a>>
    ) -> Option<Frame<'a>>;
fn map<'a>(state: Frame<'a>) -> Option<Self::T>; }

Operations common to all Conflict-free Replicated Datatypes modeled by RON.

Associated Types

type T

Rust type this CRDT can be mapped to.

Loading content...

Required methods

Important traits for Frame<'a>
fn new<'a>(obj: UUID) -> Frame<'a>

Returns the state Frame of a new, empty CRDT instance with UUID obj.

fn reduce<'a>(state: Frame<'a>, updates: Vec<Frame<'a>>) -> Option<Frame<'a>>

Reduce state Frame state and update Frames updates to a new state Frame.

fn map<'a>(state: Frame<'a>) -> Option<Self::T>

Maps the state Frame state to a Rust type.

Loading content...

Implementors

impl CRDT for LWW[src]

type T = HashMap<UUID, Atom>

impl CRDT for Set[src]

type T = HashSet<Atom>

Loading content...