#config-parser

config-file

Read and parse configuration file automatically

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

Download history 3285/week @ 2025-09-11 1721/week @ 2025-09-18 2418/week @ 2025-09-25 3160/week @ 2025-10-02 5674/week @ 2025-10-09 4632/week @ 2025-10-16 2684/week @ 2025-10-23 4080/week @ 2025-10-30 3131/week @ 2025-11-06 3781/week @ 2025-11-13 2410/week @ 2025-11-20 2100/week @ 2025-11-27 2581/week @ 2025-12-04 2217/week @ 2025-12-11 2434/week @ 2025-12-18 1750/week @ 2025-12-25

9,404 downloads per month
Used in 5 crates

BSD-2-Clause

9KB
125 lines

config-file

API Docs Downloads

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