libucl 0.2.3

Rust wrapper with bindings to libucl
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
extern crate libucl;

fn main() {
    let parser = libucl::Parser::new();

    let config = match parser.parse_file("examples/test.conf") {
        Ok(conf) => conf,
        Err(err) => panic!("{:?}", err)
    };

    println!("{:?}", config.fetch("lol").and_then(|val| val.as_string()));
    println!("{:?}", config.fetch_path("placki.duze").and_then(|val| val.as_bool()));
    println!("{:?}", config.fetch_path("placki.średnica").and_then(|val| val.as_int()));
    println!("{:?}", config.fetch_path("non.existent.path").and_then(|val| val.as_string()));
}