rust-crdt

Build Status crates.io

Thoroughly tested serializable practical CRDT's ported from riak_dt.

documentation

examples

OR-Set Without Tombstones (ORSWOT)

rust let (mut a, mut b) = (Orswot::new(), Orswot::new()); a.add("value bar".to_string(), "witnessing node A".to_string()); assert_eq!(a.value(), vec!["value bar".to_string()]); b.add("value baz".to_string(), "witnessing node B".to_string()); assert_eq!(b.value(), vec!["value baz".to_string()]); let mut c = a.clone(); assert_eq!(c.value(), vec!["value bar".to_string()]); c.merge(b); assert_eq!(c.value(), vec!["value bar".to_string(), "value baz".to_string()]); unsafe { a.remove("value bar".to_string()); } let mut d = a.clone(); d.merge(c); assert_eq!(d.value(), vec!["value baz".to_string()]);

If you want to learn about how CRDTs work, I suggest starting with the readme from aphyr's meangirls repo. Afterwards, either check out the riak dt source code or A comprehensive study of CRDTs depending on if you like to read papers or jump straight to source code examples.

references