pub fn extract(s: &str, key: &str) -> Result<JsonValue, ExtractError>
Expand description
Extract a value from a json string without parsing the whole thing.
With the object from benches/json.rs, extract()
is ~3.5x faster than
json::parse
.
ยงExamples
let value = binary_extract::extract(r#"{"foo": "bar"}"#, "foo").unwrap();
assert_eq!(value, "bar");