Trait totem_common::StorageMapExt
source · [−]pub trait StorageMapExt<K, V> where
Self: StorageMap<K, V>,
K: FullEncode + Encode + EncodeLike,
V: FullCodec + Decode + FullEncode + Encode + EncodeLike, {
fn mutate_or_err<KeyArg: EncodeLike<K>, F: FnOnce(&mut V)>(
key: KeyArg,
f: F
) -> DispatchResultWithPostInfo { ... }
}
Expand description
Adds behavior to StorageMap
s.
Provided methods
fn mutate_or_err<KeyArg: EncodeLike<K>, F: FnOnce(&mut V)>(
key: KeyArg,
f: F
) -> DispatchResultWithPostInfo
fn mutate_or_err<KeyArg: EncodeLike<K>, F: FnOnce(&mut V)>(
key: KeyArg,
f: F
) -> DispatchResultWithPostInfo
If the key exists in the map, modifies it with the provided function, otherwise, an error is returned.