Skip to main content

Module yaml

Module yaml 

Source
Expand description

YAML documents as HOCON config.

This is a HOCON library, not a YAML implementation, and the API keeps that boundary. What this module owns is the decoded-tree → HOCON step, exposed directly as from_value: root must be a mapping, ${...} stays literal, NaN and infinity are refused, a multi-document stream is refused. How YAML text becomes a tree — whether 010 is 8 or 10, whether no is a boolean — is the YAML library’s answer, not a contract here.

parse is a convenience front on yaml-rust2. A caller who needs a different library, version or schema decodes the text themselves and hands the tree to from_value; that is the supported way to swap parsers, and it keeps the choice, and its consequences, in the caller’s hands.

Functions§

from_value
Build a Config from an already-decoded YAML tree, produced by whatever library and settings the caller chose. This is the tree-level boundary this module owns; parse is just a default decoder in front of it.
parse
Read YAML text with this module’s default library.
parse_file
Read a YAML file, using its path as the origin description.