#tree-structure #malleable #foo

configuration

The package provides a malleable tree structure

11 releases (7 breaking)

Uses old Rust 2015

0.7.2 Oct 23, 2016
0.7.0 Apr 26, 2016
0.6.0 Oct 19, 2015

#557 in Configuration

Download history 9/week @ 2024-01-29 6/week @ 2024-02-19 72/week @ 2024-02-26 7/week @ 2024-03-04 15/week @ 2024-03-11

100 downloads per month

Apache-2.0/MIT

12KB
318 lines

Configuration Version Status

The package provides a malleable tree structure.

Documentation

Example

let tree = configuration::format::TOML::parse(r#"
    message = "one"

    [foo.bar]
    message = "two"

    [foo.baz]
    answer = 42
"#).unwrap();

assert_eq!(tree.get::<String>("message").unwrap(), "one");
assert_eq!(tree.get::<String>("foo.message").unwrap(), "one");
assert_eq!(tree.get::<String>("foo.bar.message").unwrap(), "two");
assert_eq!(tree.get::<String>("foo.baz.message").unwrap(), "one");

let tree = tree.branch("foo.baz").unwrap();

assert_eq!(tree.get::<i64>("answer").unwrap(), &42);

Contribution

Your contribution is highly appreciated. Do not hesitate to open an issue or a pull request. Note that any contribution submitted for inclusion in the project will be licensed according to the terms given in LICENSE.md.

Dependencies

~155KB