JSON Operators
A collection of tools to help operate on serde_json::Values.
partial_cmp
JOPS provides a function for comparing two serde_json::Value.
Examples
The partial_cmp function.
use Ordering;
use Value;
let a = Null;
let b = Null;
let res : Ordering = partial_cmp;
JsonValue wrapper provides partial_cmp.
use jops;
use Value;
let a = JsonValue;
let b = JsonValue;
let res = a > b;
JsonPath
An SQLite JSON Path implementation. Access Values inside an Object or Array.
Operators
$represents the root Value.<name>points to a sub value with keynameinside an Object<name>[<index>]points to a value inside an Arraynameatindex(zero indexed).<name>[#-<offset>]points to a value inside an Arraynameat length of array minus offset.<index>points to a value inside a root Array atindex(zero indexed).
Examples
let value = json!;
value.path; // Returns a reference to value
value.path; // Returns a reference to the String value "example"
value.path; // Returns a reference to the Number value 1 inside the array b
value.path; // Returns a reference to the Number value 1 inside the array b
let value = json!;
value.path; // Returns a reference to the Number value 2 inside the array
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.