pub struct BigMap<K: BigMapKey, V> { /* private fields */ }Expand description
Auto-incrementing dense map that generates monotone u64-backed typed keys.
Implementations§
Source§impl<K: BigMapKey, V> BigMap<K, V>
impl<K: BigMapKey, V> BigMap<K, V>
Sourcepub fn get(&self, key: &K) -> Option<&V>
pub fn get(&self, key: &K) -> Option<&V>
Returns a reference to the value for key, or None if not present.
Sourcepub fn get_mut(&mut self, key: &K) -> Option<&mut V>
pub fn get_mut(&mut self, key: &K) -> Option<&mut V>
Returns a mutable reference to the value for key, or None if not present.
Sourcepub fn insert(&mut self, value: V) -> K
pub fn insert(&mut self, value: V) -> K
Inserts a value and returns its newly generated key. Panics on u64 overflow.
Sourcepub fn remove(&mut self, key: &K) -> Option<V>
pub fn remove(&mut self, key: &K) -> Option<V>
Removes and returns the value for key, or None if not present.
Sourcepub fn contains_key(&self, key: &K) -> bool
pub fn contains_key(&self, key: &K) -> bool
Returns true if the map contains an entry for key.
Sourcepub fn iter<'a>(
&'a self,
) -> Map<Iter<'a, u64, V>, fn((&'a u64, &'a V)) -> (K, &'a V)>
pub fn iter<'a>( &'a self, ) -> Map<Iter<'a, u64, V>, fn((&'a u64, &'a V)) -> (K, &'a V)>
Returns an iterator over (K, &V) pairs in arbitrary order.
Trait Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for BigMap<K, V>
impl<K, V> RefUnwindSafe for BigMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for BigMap<K, V>
impl<K, V> Sync for BigMap<K, V>
impl<K, V> Unpin for BigMap<K, V>
impl<K, V> UnsafeUnpin for BigMap<K, V>
impl<K, V> UnwindSafe for BigMap<K, V>where
V: UnwindSafe,
K: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more