Macro json::object [−][src]
macro_rules! object {
{ } => { ... };
{ $($key : expr => $value : expr), * } => { ... };
{ $($key : expr => $value : expr,) * } => { ... };
}
Expand description
Helper macro for creating instances of JsonValue::Object
.
let data = object!{
"foo" => 42,
"bar" => false
};
assert_eq!(data["foo"], 42);
assert_eq!(data["bar"], false);
assert_eq!(data.dump(), r#"{"foo":42,"bar":false}"#);