Config organizes hierarchical or layered configurations for Rust applications.
Config lets you set a set of default parameters and then extend them via merging in configuration from a variety of sources:
- Environment variables
- String literals in well-known formats
- Another Config instance
- Files: TOML, JSON, YAML, INI, RON, JSON5 and custom ones defined with Format trait
- Manual, programmatic override (via a
.setmethod on the Config instance)
Additionally, Config supports:
- Live watching and re-reading of configuration files
- Deep access into the merged configuration via a path syntax
- Deserialization via
serdeof the configuration or any subset defined via a path
See the examples for general usage information.