Struct near_sdk::collections::UnorderedMap
source · [−]pub struct UnorderedMap<K, V> { /* private fields */ }
Expand description
An iterable implementation of a map that stores its content directly on the trie.
Implementations
Returns the number of elements in the map, also referred to as its size.
Create new map with zero elements. Use prefix
as a unique identifier.
Inserts a serialized key-value pair into the map.
If the map did not have this key present, None
is returned. Otherwise returns
a serialized value. Note, the keys that have the same hash value are undistinguished by
the implementation.
impl<K, V> UnorderedMap<K, V> where
K: BorshSerialize + BorshDeserialize,
V: BorshSerialize + BorshDeserialize,
impl<K, V> UnorderedMap<K, V> where
K: BorshSerialize + BorshDeserialize,
V: BorshSerialize + BorshDeserialize,
Removes a key from the map, returning the value at the key if the key was previously in the map.
Inserts a key-value pair into the map.
If the map did not have this key present, None
is returned. Otherwise returns
a value. Note, the keys that have the same hash value are undistinguished by
the implementation.
An iterator visiting all keys. The iterator element type is K
.
An iterator visiting all values. The iterator element type is V
.
Iterate over deserialized keys and values.
Returns a view of keys as a vector. It’s sometimes useful to have random access to the keys.
Returns a view of values as a vector. It’s sometimes useful to have random access to the values.