Expand description
Load, merge and interpolate homogeneous JSON or TOML configuration layers.
load_layers returns native Layers. Match its variant, then call
merge, optionally interpolate, and format::emit on that same
value type. No stage converts JSON to TOML or TOML to JSON.
Re-exports§
pub use format::ConfigFormat;pub use format::Format;pub use value::ConfigObject;pub use value::ConfigValue;
Modules§
- format
- Format detection, parsing and emission.
- fs
- Discover ordered configuration inputs and filter path lists without loading them.
- value
- Native value adapters for the shared merge and interpolation algorithms.
Structs§
- Cycle
- A reference that resolves, directly or indirectly, to itself.
- Merge
Options - Knobs on the merge itself. Passed by reference rather than encoded as cargo
features: features are additive and unify across a dependency graph, so a
strictfeature would silently change behaviour for one consumer the moment a second consumer enabled it. - Path
Leaf - A leaf value addressed by a parsed path.
- Process
Env - Reads raw text for
${env:NAME}. The selected native adapter types it. - RefPath
- A parsed path: dotted keys plus bracket array indices,
a.b[2].c.
Enums§
- Interp
Error - Why interpolation failed.
- Layers
- Native layers, all in one format and in the caller’s original order.
- Load
Error - Why a positional could not be turned into a layer.
- Merge
Error - Path
Error - Why a path expression was rejected.
- Problem
- One thing wrong with one reference.
- Seg
- One step of a path into a document.
- Syntax
- A malformed reference.
Constants§
- STDIN
- The positional that means “read stdin”.
Traits§
- Env
- Where
${env:NAME}reads from.
Functions§
- interpolate
- Resolves every reference in
doc. - json_
or_ string - Parses text as JSON, falling back to the string itself.
- load_
layers - Read homogeneous native layers after resolving one format for the entire list.
- merge
- Folds a list of layers into one document, seeded with an empty object.
- merge_
into - Merges
overintobasein place. - render_
path - Renders a path for display:
servers.primary.host,tags[0]. - resolve_
format - Resolve a single format without reading any document contents.
- toml_
or_ string - Parse a standalone TOML value, falling back to the original text as a string.
Surrounding TOML whitespace is ignored when parsing a literal. Invalid and
out-of-range literals, including
null, retain the original text as strings.