#config #configuration

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

#155 in Configuration

Download history 685/week @ 2023-02-11 980/week @ 2023-02-18 1548/week @ 2023-02-25 966/week @ 2023-03-04 1304/week @ 2023-03-11 867/week @ 2023-03-18 980/week @ 2023-03-25 857/week @ 2023-04-01 784/week @ 2023-04-08 738/week @ 2023-04-15 731/week @ 2023-04-22 780/week @ 2023-04-29 1113/week @ 2023-05-06 769/week @ 2023-05-13 800/week @ 2023-05-20 825/week @ 2023-05-27

3,692 downloads per month
Used in du-dust

BSD-2-Clause

8KB
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.7–1.6MB
~38K SLoC