Sample CRDTs

A repository containing some CRDTs implementations in Rust.

| CRDT | Type | Tests | | --- | --- | --- | | [Aworset] Add-Wins Observed Remove Set| State-Based | aworset.rs | | [Aworset Optimized] Add-Wins Observed Remove Set | State-Based | --- | | [GCounter] Grow-Only Counter| State-Based | -- | | [PnCounter] Positive-Negative Counter| State-Based | -- | | [MvReg] Multi-Value Register [on progress]| State-Based | --- | --- |

Auxiliary structures

Some auxiliary structures were built to create some CRDTs:

| Name | Tests | Explanation | Reference | | --- | --- | --- | --- | | DotContext | dotcontext.rs | Bartosz Sypytkowski Blog | delta-enabled-crdts |

Usage

The cargo package is available at: - https://crates.io/crates/crdt-sample

Add the following piece of code to your Cargo.toml:

toml [dependencies] crdt-sample = "0.1.0"

Example

```rust use crdtsample::{AworsetOpt, NodeId}; fn main() { let nodeid = NodeId::new(1, "addr".tostring()); let mut aworset: AworsetOpt = AworsetOpt::new(nodeid); aworset.add(1); println!("{:?}", aworset); // AworsetOpt { id: addr1, set: {(addr1, 1, 1)}, cc: DotContext { cc: {addr1: 1}, dc: {} } } }

```

References