pub enum ConfigLayer {
File(PathBuf),
EnvPrefix(String),
Overrides(BTreeMap<String, Value>),
}Expand description
One named source of configuration values.
Layers are applied by ConfigBuilder::layer
in the order they are added. A later layer’s keys replace earlier ones,
while tables merge key-by-key (deep merge), so a late layer can override
a single nested field without clobbering its siblings. Driven in the
documented order this yields precedence overrides > env > file.
Variants§
File(PathBuf)
A configuration file, parsed at load time by extension: .json
(feature json), .yaml/.yml (feature yaml), and anything
else — including no extension — as TOML.
EnvPrefix(String)
All environment variables sharing a prefix. The prefix is stripped and the remainder lowercased to form the top-level key; values are typed by inference (see the crate root for the exact rules).
Overrides(BTreeMap<String, Value>)
In-process values, typically assembled by a supervisor or test. Applied last in the documented order, hence highest precedence.
Implementations§
Source§impl ConfigLayer
impl ConfigLayer
Trait Implementations§
Source§impl Clone for ConfigLayer
impl Clone for ConfigLayer
Source§fn clone(&self) -> ConfigLayer
fn clone(&self) -> ConfigLayer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more