m

Macro m 

Source
macro_rules! m {
    () => { ... };
    ( $($tt:tt)+ ) => { ... };
}
Expand description

Construct a map::Map value.

The macro automatically detects nested arrays [...] and maps {...}, so you don’t need to explicitly use a! and m! for nested structures.

// Auto-detection syntax (recommended)
let value = m! {
    "code": 200,
    "success": true,
    "payload": {
        "some": [
            "pay",
            "loads",
        ]
    }
};

// Or explicit macro syntax (also works)
let value2 = m! {
    "code": 200,
    "success": true,
    "payload": m! {
        "some": a![
            "pay",
            "loads",
        ]
    }
};