yaml_rt/lib.rs
1//! YAML 1.2.2 parsing, source-preserving editing, typed overlays, and optional
2//! Serde conversion.
3//!
4//! `YamlDoc` keeps the original source as its source of truth. Unedited YAML is
5//! returned byte-for-byte, while editor operations queue localized changes and
6//! [`YamlPatch`] applies multi-operation YAML or JSON patches transactionally.
7//!
8//! ```
9//! use yaml_rt::{YamlDoc, YamlError};
10//!
11//! # fn main() -> Result<(), YamlError> {
12//! let mut doc = YamlDoc::parse("port: 8080 # selected port\n")?;
13//! doc.set_scalar(&["port"], "9090")?;
14//! assert_eq!(doc.to_string(), "port: 9090 # selected port\n");
15//! # Ok(())
16//! # }
17//! ```
18//!
19//! The default `derive` feature re-exports [`YamlRt`] for named mapping
20//! structs, transparent newtypes, and locally tagged enums. The optional
21//! `serde` feature re-exports serialization and deserialization APIs for
22//! conversions where presentation preservation is not required, including a
23//! generic `Value` model.
24
25pub use yaml_rt_core::*;
26
27#[cfg(feature = "derive")]
28pub use yaml_rt_derive::YamlRt;
29
30#[cfg(feature = "serde")]
31pub use yaml_rt_serde::{
32 Deserializer, Error, Index, Location, Mapping, Number, Result, Sequence, Serializer, Value,
33 from_reader, from_slice, from_str, from_value, to_string, to_value, to_writer,
34};