colla 0.1.0

Operational Transformation library for nested documents with text and rich-text
Documentation
1
2
3
4
5
6
7
8
9
10
use colla::{path, Value};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let base = Value::map([("title", Value::text("Draft"))])?;
    let mut builder = base.change();
    builder.text_insert(&path!["title"], 5, " v2")?;
    let after = builder.build().apply_to(&base)?;
    println!("{after:?}");
    Ok(())
}