1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! A pure-Rust library of thoroughly-tested, serializable CRDT's.
//!
//! [Conflict-free Replicated Data Types][crdt] (CRDTs) are data structures
//! which can be replicated across multiple networked nodes, and whose
//! properties allow for deterministic, local resolution of
//! possible inconsistencies which might result from concurrent
//! operations.
//!
//! [crdt]: https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type
#![crate_type = "lib"]
#![deny(missing_docs)]

mod error;
pub use crate::error::Error;

mod traits;
pub use crate::traits::{Causal, CmRDT, CvRDT, FunkyCmRDT, FunkyCvRDT};

/// This module contains a Last-Write-Wins Register.
pub mod lwwreg;

/// This module contains a Multi-Value Register.
pub mod mvreg;

pub mod vclock;

/// This module contains an Observed-Remove Set With Out Tombstones.
pub mod orswot;

/// This module contains a Grow-only Counter.
pub mod gcounter;

/// This module contains a Grow-only Set.
pub mod gset;

/// This module contains a Positive-Negative Counter.
pub mod pncounter;

/// This module contains a Map with Reset-Remove and Observed-Remove semantics.
pub mod map;

/// This module contains context for editing a CRDT.
pub mod ctx;

// Top-level re-exports for CRDT structures.
pub use crate::{
    gcounter::GCounter,
    gset::GSet,
    lwwreg::LWWReg,
    map::Map,
    mvreg::MVReg,
    orswot::Orswot,
    pncounter::PNCounter,
    vclock::{Dot, VClock},
};