Module threshold::tclock[][src]

This module contains an implementation of a threshold clock.

The concept of threshold-union is explained in detail in this blog post.

Examples

use threshold::{clock, *};

let vclock_0 = clock::vclock_from_seqs(vec![10, 5, 5]);
let vclock_1 = clock::vclock_from_seqs(vec![8, 10, 6]);

let mut tclock = TClock::new();
tclock.add(vclock_0);
tclock.add(vclock_1);

let vclock_t1 = clock::vclock_from_seqs(vec![10, 10, 6]);
let vclock_t2 = clock::vclock_from_seqs(vec![8, 5, 5]);

assert_eq!(tclock.threshold_union(1), (vclock_t1, true));
assert_eq!(tclock.threshold_union(2), (vclock_t2, false));

Structs

TClock