pub trait YmlConfig<T = HashMap<String, String>>: AbstractConfig<T> {
// Provided methods
fn load(target: Option<String>) -> Result<T, Error>
where T: Default,
HashMap<String, String>: Into<T>,
Self: Sized { ... }
fn load_with_override(
target: Option<String>,
excluded_keys: &HashSet<String>,
) -> Result<T, Error>
where T: Default,
HashMap<String, String>: Into<T>,
Self: Sized { ... }
}Expand description
Indicates that structure can be initialized from YAML/YML file.
Provided Methods§
Sourcefn load_with_override(
target: Option<String>,
excluded_keys: &HashSet<String>,
) -> Result<T, Error>
fn load_with_override( target: Option<String>, excluded_keys: &HashSet<String>, ) -> Result<T, Error>
Load specified YAML/YML file with explicit control over which keys should not be overridden.
§Arguments
target- Path to the YAML/YML file.excluded_keys- Keys that should not be overridden by environment variables.
§Errors
Error::LoadFileError- If the specified YAML/YML file cannot be loaded or parsed.