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

#276 in Configuration

Download history 1483/week @ 2024-11-16 1408/week @ 2024-11-23 1462/week @ 2024-11-30 6025/week @ 2024-12-07 2421/week @ 2024-12-14 55942/week @ 2024-12-21 5762/week @ 2024-12-28 4095/week @ 2025-01-04 1588/week @ 2025-01-11 1283/week @ 2025-01-18 5915/week @ 2025-01-25 3173/week @ 2025-02-01 1374/week @ 2025-02-08 8108/week @ 2025-02-15 2781/week @ 2025-02-22 1818/week @ 2025-03-01

14,329 downloads per month
Used in 4 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();

lib.rs:

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.4MB
~30K SLoC