6 releases (1 stable)

✓ Uses Rust 2018 edition

1.0.0 Aug 29, 2019
0.9.0 May 13, 2019
0.8.0 May 13, 2019
0.7.0 May 13, 2019
0.5.0 May 13, 2019

#85 in Value formatting

Download history 44/week @ 2019-12-10 7/week @ 2019-12-24 3/week @ 2019-12-31 109/week @ 2020-01-07 18/week @ 2020-01-14 13/week @ 2020-01-21 3/week @ 2020-01-28 5/week @ 2020-02-04 6/week @ 2020-02-11 12/week @ 2020-02-18 12/week @ 2020-02-25 12/week @ 2020-03-03 3/week @ 2020-03-10 18/week @ 2020-03-17 21/week @ 2020-03-24

57 downloads per month

Apache-2.0

9KB
210 lines

nbconf

crates.io Documentation

Simple configuration file reader/writer. This is intended for use with config files that are human readable but machine written.

Format

The format is simple: key-value pairs nested under sections. Example:

[Section 1]
hello = world

[Section 2]
nice to = meet you

lib.rs:

Example:

let conf = nbconf::Conf::parse_str("
    [Section 1]
    hello = world

    [Section 2]
    nice to = meet you").expect("failed to parse config");

assert_eq!(conf.sections[0].name, "Section 1");
assert_eq!(conf.sections[0].entries[0].key, "hello");
assert_eq!(conf.sections[0].entries[0].value, "world");

assert_eq!(conf.sections[1].name, "Section 2");
assert_eq!(conf.sections[1].entries[0].key, "nice to");
assert_eq!(conf.sections[1].entries[0].value, "meet you");

No runtime deps