#toml-config #toml #configuration

ezconf

A library for easily making your program configurable

3 releases (breaking)

Uses old Rust 2015

0.3.0 Oct 22, 2018
0.2.0 May 29, 2018
0.1.0 May 9, 2018

#117 in #toml-config

Download history 4/week @ 2024-09-09 25/week @ 2024-09-23 8/week @ 2024-09-30 2/week @ 2024-10-07 13/week @ 2024-10-14 7/week @ 2024-10-28 9/week @ 2024-11-04 11/week @ 2024-11-18 3/week @ 2024-11-25 53/week @ 2024-12-09

67 downloads per month

MIT/Apache

11KB
137 lines

ezconf Build Status docs.rs

A library to add configuration options to your project with as little boilerplate as possible. Uses toml as the configuration format.

Example

extern crate ezconf;

static CONFIG: ezconf::Config = ezconf::INIT;

fn main() {
    CONFIG
        .init([ezconf::Source::File("tests/test.toml")].iter())
        .unwrap();

    let v = CONFIG.get_or::<String>("string.a", "Hello String".into());
    println!("Value: {:?}", v);
}

License

ezconf is licensed under either of

at your option.


lib.rs:

ezconf

A library to add configuration options to your project with as little boilerplate as possible. Uses toml as the configuration format.

Note: In previous versions, values were cached. This is no longer the case! If you need maximum performance, call get before doing anything time-critical.

Example

extern crate ezconf;

static CONFIG: ezconf::Config = ezconf::INIT;

fn main() {
    CONFIG
        .init([ezconf::Source::File("tests/test.toml")].iter())
        .unwrap();

    let v = CONFIG.get_or::<String>("string.a", "Hello String".into());
    println!("Value: {:?}", v);
}

Dependencies

~7–16MB
~175K SLoC