euklid 0.0.4

Library for CRDT
Documentation
  • Coverage
  • 100%
    11 out of 11 items documented0 out of 0 items with examples
  • Size
  • Source code size: 34.9 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.06 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • veminovici/euklid
    3 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • veminovici

Simplee |> Euklid

Rust crate for the CRDTs.

rust build test clippy Coverage Status Tag Last commit Repo size

Github Actions

Dot

The Dot is implementing a marked version.

extern crate euklid;
use euklid::Dot;

// Create a dot for actor Alice.
let mut dot = Dot::new("Alice".to_string(), 0);
// Increment the dot.
dot.apply_inc();

More examples can be found in the example file.

Vector Clock

The VClock is implementing a vector clock.

extern crate euklid;
use euklid::{Dot, VClock};

// Create a vclock and increment the counter for user A.
let mut a = VClock::new();

// Increment the counter for actor A
a.apply(a.inc_op("A"));

// Increment the counter for actor B
a.apply(a.inc_op("B"));

More examples can be found in the example file.

G-Counter

The GCounter is implementing a grow-only counter.

xtern crate euklid;
use euklid::{Dot, GCounter};

// Create a vclock and increment the counter for user A.
let mut a = VGounter::new();

// Increment the counter for actor A
a.apply(a.inc_op("A"));

// Increment the counter for actor B
a.apply(a.inc_op("B"));

// Increase the counter for actor A by 5
a.apply(a.step_op("A", 5));

More examples can be found in the example file.

Resources

Thank you!!!

You can contact me at veminovici@hotmail.com. Code designed and written in Päädu, on the beautiful island of Saaremaa, Estonia.