macro_rules! proto_object {
($($obj:tt)+) => { ... };
}Expand description
Construct a QueryParams from a Js object-like literal.
use urlqstring::proto_object;
let value = proto_object!({
"rust": "A sytem language",
"python": "A script language",
"apple": "A fruit"
});Variables or expressions can be inserted into the object-like literal.
use urlqstring::proto_object;
let rust = "A system language";
let python = ["script language", "dynamic language"];
let value = proto_object!({
"rust": rust,
"python": python
});Trailing commas are allowed inside both arrays and objects.
use urlqstring::proto_object;
let value = proto_object!({
"id": 1024,
"name": "rust",
"comma": true,
});