Struct near_sdk::collections::LookupMap [−][src]
pub struct LookupMap<K, V> { /* fields omitted */ }
Expand description
An non-iterable implementation of a map that stores its content directly on the trie.
Implementations
Create a new map. Use key_prefix
as a unique prefix for keys.
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.
Returns true if the map contains a given key.
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.
Trait Implementations
Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes. Read more
Deserialize this instance from a slice of bytes.
Whether Self is u8.
NOTE: Vec<u8>
is the most common use-case for serialization and deserialization, it’s
worth handling it as a special case to improve performance.
It’s a workaround for specific Vec<u8>
implementation versus generic Vec<T>
implementation. See https://github.com/rust-lang/rfcs/pull/1210 for details. Read more
Serialize this instance into a vector of bytes.
Whether Self is u8.
NOTE: Vec<u8>
is the most common use-case for serialization and deserialization, it’s
worth handling it as a special case to improve performance.
It’s a workaround for specific Vec<u8>
implementation versus generic Vec<T>
implementation. See https://github.com/rust-lang/rfcs/pull/1210 for details. Read more
Auto Trait Implementations
impl<K, V> RefUnwindSafe for LookupMap<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> UnwindSafe for LookupMap<K, V> where
K: UnwindSafe,
V: UnwindSafe,