pub trait ConfigSource {
// Required method
fn load(&self) -> Result<ConfigValue, ParserError>;
// Provided method
fn priority(&self) -> u8 { ... }
}Expand description
Trait defining a configuration source.
A ConfigSource is an entity capable of yielding a ConfigValue,
which can represent configuration data from various sources, such as files,
environment variables, or CLI arguments.
Required Methods§
Sourcefn load(&self) -> Result<ConfigValue, ParserError>
fn load(&self) -> Result<ConfigValue, ParserError>
Load configuration from the source.
Returns a Result containing either the configuration value
(ConfigValue) or a parsing error (ParserError) if loading fails.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".