hjson-rust for serde
{
# specify rate in requests/second (because comments are helpful!)
rate: 1000
// prefer c-style comments?
/* feeling old fashioned? */
# did you notice that rate doesn't need quotes?
hey: look ma, no quotes for strings either!
# best of all
notice: []
anything: ?
# yes, commas are optional!
}
The Rust implementation of Hjson is based on the Serde JSON Serialization Library. For other platforms see hjson.github.io.
This crate is a Rust library for parsing and generating Human JSON Hjson. It is built upon Serde, a high performance generic serialization framework.
Install
This crate works with Cargo and can be found on crates.io with a Cargo.toml like:
[]
= "*"
= "*"
From the Commandline
Install with cargo install hjson
Hjson, the Human JSON.
Usage:
hjson [options]
hjson [options] <input>
hjson (-h | --help)
hjson (-V | --version)
Options:
-h --help Show this screen.
-j Output as formatted JSON.
-c Output as JSON.
-V --version Show version.
Sample:
- run
hjson test.json > test.hjsonto convert to Hjson - run
hjson -j test.hjson > test.jsonto convert to JSON
Usage
extern crate serde;
extern crate serde_hjson;
use ;