VClockBig

Type Alias VClockBig 

Source
pub type VClockBig<K> = VClock<K, BigUint>;
Expand description

Vector clock using bigint counters.

Requires feature “bigint”.

Normally a Vector64 or even Vector128 should be good enough for all cases, but this is here “just in case” the standard capacities do not fit. Also serves as a practical proof that you’re not limited by Rust primitive types.

§Examples

use vclock::VClockBig;

// key type can be inferred
let mut c = VClockBig::default();
c.incr(&"a");
c.incr(&"a");
c.incr(&"a");
c.incr(&"b");
c.incr(&"b");
assert_eq!(2, c.get(&"a").unwrap().to_u64_digits()[0]);
assert_eq!(1, c.get(&"b").unwrap().to_u64_digits()[0]);
assert_eq!(None, c.get(&"c"));

Aliased Type§

pub struct VClockBig<K> { /* private fields */ }