8 releases
| 0.2.3 | Apr 8, 2022 |
|---|---|
| 0.2.2 | Apr 8, 2022 |
| 0.2.1 | Apr 6, 2021 |
| 0.1.3 | Apr 2, 2021 |
#430 in Configuration
9,404 downloads per month
Used in 5 crates
9KB
125 lines
config-file
Read and parse configuration file automatically
config-file reads your configuration files and parse them automatically using their extension.
Features
- toml is enabled by default
- json is optional
- xml is optional
- yaml is optional
Examples
use config_file::FromConfigFile;
use serde::Deserialize;
#[derive(Deserialize)]
struct Config {
host: String,
}
let config = Config::from_config_file("/etc/myconfig.toml").unwrap();
Dependencies
~0.3–1.5MB
~32K SLoC