Nondestructive editing tries to preserve as much as possible of the existing structure, while allowing the document to be modified in place.
This project is as of yet, incomplete!
See the corresponding module for detailed documentation on how to use:
```rust use anyhow::Context; use nondestructive::yaml;
let mut doc = yaml::from_slice( r#" name: Descartes country: Grece "# )?;
let mapping = doc.root().asmapping().context("missing mapping")?; let name = mapping.get("name").context("missing name")?; asserteq!(name.as_str(), Some("Descartes"));
let mut mapping = doc.rootmut().intomappingmut().context("missing mapping")?; let mut name = mapping.getmut("name").context("missing name")?; name.set_string("Plato");
let mut country = mapping.getmut("country").context("missing country")?; country.setstring("Greece");
asserteq!( doc.tostring(), r#" name: Plato country: Greece "# ); ```