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.
23
24pub use yaml_rt_core::*;
25
26#[cfg(feature = "derive")]
27pub use yaml_rt_derive::YamlRt;
28
29#[cfg(feature = "serde")]
30pub use yaml_rt_serde::{
31 Deserializer, Error, Location, Result, Serializer, from_reader, from_slice, from_str,
32 to_string, to_writer,
33};