Macro sk_cbor::cbor_map[][src]

macro_rules! cbor_map {
    ($($key : expr => $value : expr,) +) => { ... };
    ($($key : expr => $value : expr), *) => { ... };
}
Expand description

Creates a CBOR Value of type Map with the specified key-value pairs.

Keys and values are expressions and converted into CBOR Keys and Values. The syntax for these pairs is key_expression => value_expression,. Duplicate keys will lead to invalid CBOR, i.e. writing these values fails. Keys do not have to be sorted.

Example usage:

let map = cbor_map! {
  0x01 => false,
  "02" => -3,
};