configuration 0.6.0

The package provides a malleable tree structure.
Documentation

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

Contributing

  1. Fork the project.
  2. Implement your idea.
  3. Open a pull request.