Crate ucl [] [src]

UCL (Universal Configuration Library)

This library is parser for UCL files.

Basic structure

UCL provide support for 2 different syntaxes:

Differences between UCL and JSON:

Parser usage

Simple example:

static DOC: &'static str = r#"
param = value;
section {
    flag = true;
    number = 10k;
    subsection {
        hosts = {
            host = "localhost";
            port = 9000
        }
        hosts = {
            host = "remotehost"
            port = 9090
        }
    }
}
"#;

let parser = ucl::Parser::new();
let document = parser.parse(DOC).unwrap();

assert_eq!(document.fetch("param").unwrap().as_string(), Some("value".to_string()));

Reexports

pub use error::Error;
pub use parser::Parser;
pub use object::Object;

Modules

error
object
parser

Type Definitions

Result