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.
- glob
- Validated glob predicates and quoted, dotted key-path selectors.
- value
- Native value adapters for the shared merge and interpolation algorithms.
Structs§
- Cycle
- A reference that resolves to itself, reported as the full chain.
- Merge
Options - Merge options.
- Path
Leaf - A leaf value addressed by a parsed path:
server.port=8080. - Process
Env - Reads raw text for
${env:NAME}. The selected native adapter types it. - RefPath
- A non-empty parsed path: dotted keys plus bracket indices,
a.b[2].c.
Enums§
- Interp
Error - Why interpolation failed: every problem found, or a single cycle.
- 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. Carries only the path text.
- 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.ProcessEnvreads the real environment.
Functions§
- interpolate
- Resolves every reference in
doc. Call once, on the merged document. - json_
or_ string - Parses text as JSON, falling back to the string itself:
8080is a number,foois"foo". - load_
layers - Read homogeneous native layers after resolving one format for the entire list.
- merge
- Left-folds layers into one document, starting from an empty object.
- merge_
into - Merges
overintobasein place (jq’sa * b). - 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 - Parses text as a TOML value, falling back to the original text as a string.