1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
# config-file
[](https://docs.rs/config-file)
[](https://crates.io/crates/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
```rust
use config_file::FromConfigFile;
use serde::Deserialize;
#[derive(Deserialize)]
struct Config {
host: String,
}
let config = Config::from_config_file("/etc/myconfig.toml").unwrap();
```
|