Macro json
#[macro_export]
macro_rules! json {
($($json:tt)+) => { ... };
}
Construct a serde_json::Value from a JSON literal.
# use json;
#
let value = json!;
Variables or expressions can be interpolated into the JSON literal. Any type
interpolated into an array element or object value must implement Serde's
Serialize trait, while any type interpolated into an object key must
implement Into<String>. If the Serialize implementation of the
interpolated type decides to fail, or if the interpolated type contains a
map with non-string keys, the json! macro will panic.
# use json;
#
let code = 200;
let features = vec!;
let value = json!;
Trailing commas are allowed inside both arrays and objects.
# use json;
#
let value = json!;