VClock32

Type Alias VClock32 

Source
pub type VClock32<K> = VClock<K, u32>;
Expand description

Vector clock using u32 counters.

About capacity: considering a computer which would increase the clock for a given key, at a constant rate of 1000 updates/sec, the clock would be filled after about 50 days. So this is “large”, but the capacity can be reached under edge cases, yet realistic conditions. Napkin math: pow(2,32)/(1000*24*3600) -> 50

§Examples

use vclock::VClock32;

// key type can be inferred
let mut c = VClock32::default();
c.incr(&"a");
c.incr(&"a");
c.incr(&"b");
assert_eq!(Some(1), c.get(&"a"));
assert_eq!(Some(0), c.get(&"b"));
assert_eq!(None, c.get(&"c"));

Aliased Type§

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