hocon 0.1.0

Reads HOCON configuration files
Documentation

HOCON.rs License: MIT Build Status Coverage Status Realease Doc Crate

Parse HOCON configuration files in Rust

The API docs for the master branch are published here.

Usage

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

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

assert_eq!(doc["b"].as_i64().unwrap(), 10);

Status

https://github.com/lightbend/config/blob/master/HOCON.md

  • parsing JSON
  • comments
  • omit root braces
  • key-value separator
  • commas are optional if newline is present
  • whitespace
  • duplicate keys and object merging
  • unquoted strings
  • multi-line strings
  • value concatenation
  • path expressions
  • path as keys
  • substitutions
  • includes
  • conversion of numerically-indexed objects to arrays