pub struct YamlCodec;Expand description
Built-in YAML codec.
Decodes YAML into the canonical Value tree and encodes a value tree back to YAML.
Like the TOML codec, the top-level value must be a mapping (the crate’s document
contract for config-shaped formats), and a non-mapping top level surfaces as a
typed error rather than a panic — on both decode and encode, so round-trips stay symmetric.
§Security
Unlike TOML and JSON, YAML supports anchors and aliases, which the parser expands
during decode. A small hostile document can therefore reference-expand into a much
larger in-memory tree (“billion laughs”). This codec does not itself cap expansion,
so callers must decode only size-bounded input — the same trust boundary the other
codecs rely on (e.g. rskit-fs bounded reads). Do not feed unbounded or untrusted
streams straight into decode_value.