Skip to main content

map

Macro map 

Source
macro_rules! map {
    () => { ... };
    ($($k:expr => $v:expr),+ $(,)?) => { ... };
}
Expand description

Construct a CBOR map from a list of key => value pairs.

Keys and values are converted into Value.


let empty = map!{};
assert_eq!(empty.len(), Some(0));

let m = map! { "x" => 1, "y" => 2 };
assert!(m.data_type().is_map());