Macro soroban_sdk::map

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

Create a Map with the given key-value pairs.

The first argument in the list must be a reference to an Env, then the key-value pairs follow in a tuple (key, value).

Examples

use soroban_sdk::{Env, Map, map};

let env = Env::default();
let map = map![&env, (1, 10), (2, 20)];
assert_eq!(map.len(), 2);