#config #configuration

config-file

Read and parse configuration file automatically

6 releases

0.2.1 Apr 6, 2021
0.2.0 Apr 2, 2021
0.1.3 Apr 2, 2021

#72 in Configuration

Download history 6/week @ 2021-09-28 1/week @ 2021-10-05 95/week @ 2021-10-12 2/week @ 2021-10-19 4/week @ 2021-10-26 3/week @ 2021-11-02 44/week @ 2021-11-09 16/week @ 2021-11-16 34/week @ 2021-11-23 76/week @ 2021-11-30 7/week @ 2021-12-07 2/week @ 2021-12-14 1/week @ 2021-12-21 2/week @ 2021-12-28 6/week @ 2022-01-04 97/week @ 2022-01-11

106 downloads per month

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.6–1.5MB
~35K SLoC