Either (a) add a get(&k) function to the stdlib (like Rust); or (b) use a special syntax to access values at a given key in a Mapping<K, V> (perhaps dot syntax; i.e., treat Mapping similar to structs?).
E.g.,
let mut balances: Mapping<h160, u256> = Mapping::new();
let alice_addr: h160 = $0x12345123451234512345;
balances.insert(alice, 0x1_000_000 as u256);
let alice_balance = balances.get(&alice_addr);
// or
let alice_balance = balances.alice_addr;
Either (a) add a
get(&k)
function to thestdlib
(like Rust); or (b) use a special syntax to access values at a given key in aMapping<K, V>
(perhaps dot syntax; i.e., treatMapping
similar to structs?).E.g.,