This module contains the Vector Clock
This module contains a generic Vector Clock implementation.
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);
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).
|