[][src]Crate hocon

HOCON

Parse HOCON configuration files in Rust

use hocon::Hocon;

let s = r#"{"a":5}"#;
let doc = Hocon::load_from_str(s).unwrap();
let a = doc["a"].as_i64();

Support serde to deserialize to a struct

use serde::Deserialize;

#[derive(Deserialize)]
struct Configuration {
    host: String,
    port: u8,
    auto_connect: bool,
}

let s = r#"{host: 127.0.0.1, port: 80, auto_connect: false}"#;

let conf: Configuration = hocon::serde::from_str(s).unwrap();

Modules

serde

Deserialization module using serde

Enums

Hocon

HOCON document