pub fn load<T: DeserializeOwned>(dir: &Path, env_prefix: &str) -> CoreResult<T>Expand description
Loads a layered configuration into any deserializable type.
Layers, later overriding earlier:
<dir>/default.toml(required)<dir>/<APP_ENV>.toml(optional;APP_ENVdefaults todevelopment)<dir>/local.toml(optional, git-ignored developer overrides)- Environment variables
<PREFIX>__SECTION__KEY(e.g.LAT__DATABASE__URL); the prefix an application declares asapp.env_prefixis read withdeclared_env_prefixand passed here.