Macro json

Source
macro_rules! json {
    ( $lit:literal ) => { ... };
    ( { $e:expr } ) => { ... };
    ( [ $( $e:tt ),* $(,)? ] ) => { ... };
    ( { $( $key:literal : $val:tt ),* $(,)? } ) => { ... };
    ( null ) => { ... };
}
Expand description

Builds a Json object

ยงExample

use json::json;

let j = json!({
    "hello" : ["w", 0, "r", "ld"],
    "array" : [
        { "key" : "val" },
        12.21,
        null,
        true,
        false
    ]
});