pub trait ConfigSource {
// Required method
fn config_path(&self) -> Option<&Path>;
// Provided method
fn config_format(&self) -> Option<ConfigFormat> { ... }
}Expand description
Provides configuration path and format discovery for fallback loading.
Required Methods§
Sourcefn config_path(&self) -> Option<&Path>
fn config_path(&self) -> Option<&Path>
Returns the config file path when fallback should be attempted.
Provided Methods§
Sourcefn config_format(&self) -> Option<ConfigFormat>
fn config_format(&self) -> Option<ConfigFormat>
Returns a config format if it can be resolved.
The default implementation infers from extension:
.toml(tomlfeature).yaml/.yml(yamlfeature).json(jsonfeature)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".