configuration 0.7.2

The package provides a malleable tree structure.

Crate configuration [] [src]

Malleable tree structure.

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);

Modules

format

File formats.

Structs

Error

An error.

Node

A node.

Tree

A tree.

Type Definitions

Result

A result.