JMESPath for Rust
Rust implementation of JMESPath, a query language for JSON.
Installing
This crate is on crates.io and can be used
by adding jmespath to the dependencies in your project's Cargo.toml.
[]
= "0.4"
If you are using a nightly compiler, or reading this when specialization in Rust
is stable (see rust#31844), then
enable the specialized feature to switch on usage of specialization to get more
efficient code:
[]
= "0.4"
= ["specialized"]
Examples
extern crate jmespath;
let expr = compile.unwrap;
// Parse some JSON data into a JMESPath variable
let json_str = r#"{"foo": {"bar": true}}"#;
let data = from_json.unwrap;
// Search the data with the compiled expression
let result = expr.search.unwrap;
assert_eq!;