Function to_value
fn to_value<T>(value: T) -> Result<Value, crate::error::Error>
where
T: Serialize
Convert a T into serde_json::Value which is an enum that can represent
any valid JSON data.
Example
use Serialize;
use json;
use Error;
#
# compare_json_values.unwrap;
Errors
This conversion can fail if T's implementation of Serialize decides to
fail, or if T contains a map with non-string keys.
use BTreeMap;