pub trait ConfigSource {
// Required method
fn toml_value(&self, key: &str) -> Option<&Value>;
// Provided methods
fn env_var(&self, suffix: &str) -> Option<String> { ... }
fn env_name(&self) -> Option<&str> { ... }
}Expand description
Something a field’s assembly instructions can be checked against: “do you
have a TOML-shaped value for this key” and “do you have a string value for
an env var with this suffix.” EnvConfig::assemble walks a whole
SourceChain of these, in priority order, so more than one kind of
fallback source can contribute to the same struct.
Required Methods§
Sourcefn toml_value(&self, key: &str) -> Option<&Value>
fn toml_value(&self, key: &str) -> Option<&Value>
The raw TOML value stored under key, if this source has one.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".