Configuration
The package provides a malleable tree structure.
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
- Fork the project.
- Implement your idea.
- Open a pull request.