#json #dynamic #access

djson

Easily Access Dynamic JSON in Rust

1 unstable release

0.1.0 Sep 16, 2020

#212 in #access

MIT/Apache

7KB
126 lines

djson - Access Dynamic JSON in Rust

Example:

let json_str = include_str!("../test.json");

let value: Value = djson::from_str(json_str).unwrap();
let idxs = Index::parse("four[2].one").unwrap();

let res = djson::get_value(&value, &idxs);
println!("{:#?}", res);

let res = djson::get_value_dyn(&value, &[&"four", &2, &"one"]);
println!("{:#?}", res);

Dependencies

~0.5–1MB
~20K SLoC