4 releases

Uses old Rust 2015

0.1.3 Aug 3, 2024
0.1.2 Apr 12, 2017
0.1.1 Nov 21, 2016
0.1.0 Nov 9, 2016

#845 in Data structures

Apache-2.0

34KB
803 lines

Build Status

Interval Tree Clocks

Implementation of itc2008

Documentation

https://docs.rs/itc


lib.rs:

Interval Tree Clocks

The itc crate implements Interval Tree Clocks as described in http://gsd.di.uminho.pt/members/cbm/ps/itc2008.pdf

Usage:

use itc::*;

let s = Stamp::seed();

let (s1, s2) = s.fork();
let s1prime = s1.event();
let s2prime = s2.event();
let s3 = s2prime.join(&s1);

assert!(s.leq(&s1));
assert!(s1.leq(&s1prime));
assert!(!s1prime.leq(&s2prime));
assert!(s2prime.leq(&s3));

This module implements the 4 verbs: fork, event, join, peek, the 3 derived verbs: send, receive and sync, and a partial ordering to establish causality / the happens-before relation. Also in the box is a simple ascii coding representation suitable for printing to stdout and use in protocols.

No runtime deps