Skip to main content

load_config

Function load_config 

Source
pub fn load_config(path: impl AsRef<Path>) -> Result<Config>
Expand description

Read one config file at path into a Config, validating it on the way.

The validation is the config’s self-guard: serde’s deny_unknown_fields rejects keys that aren’t part of the schema, missing required keys and wrong-typed values are type errors, and malformed TOML fails to parse. Any of these surfaces as an Err rather than a silently-accepted default.