[][src]Module crdts::vclock

This module contains a generic Vector Clock implementation.

Examples

use crdts::{Dot, VClock, CmRDT};

let mut a = VClock::new();
let mut b = VClock::new();
a.apply(Dot::new("A", 2));
b.apply(Dot::new("A", 1));
assert!(a > b);

Structs

Dot

Dot is a version marker for a single actor

IntoIter

Generated from calls to VClock::into_iter()

VClock

A VClock is a standard vector clock. It contains a set of "actors" and associated counters. When a particular actor witnesses a mutation, their associated counter in a VClock is incremented. VClock is typically used as metadata for associated application data, rather than as the container for application data. VClock just tracks causality. It can tell you if something causally descends something else, or if different replicas are "concurrent" (were mutated in isolation, and need to be resolved externally).

Traits

Actor

Common Actor type. Actors are unique identifier for every thing mutating a VClock. VClock based CRDT's will need to expose this Actor type to the user.