pub struct StableBTreeMap<K: Storable + Ord + Clone, V: Storable, M: Memory = DefaultMemoryImpl> { /* private fields */ }Expand description
Governed upstream BTreeMap; initialization and failures follow upstream contracts.
Implementations§
Source§impl<K: Storable + Ord + Clone, V: Storable, M: Memory> StableBTreeMap<K, V, M>
impl<K: Storable + Ord + Clone, V: Storable, M: Memory> StableBTreeMap<K, V, M>
Sourcepub fn new(memory: RuntimeMemory<M>) -> Self
pub fn new(memory: RuntimeMemory<M>) -> Self
Delegates to upstream BTreeMap::new with the governed allocation.
Sourcepub fn init(memory: RuntimeMemory<M>) -> Self
pub fn init(memory: RuntimeMemory<M>) -> Self
Delegates to upstream BTreeMap::init with the governed allocation.
Sourcepub fn load(memory: RuntimeMemory<M>) -> Self
pub fn load(memory: RuntimeMemory<M>) -> Self
Delegates to upstream BTreeMap::load with the governed allocation.
Sourcepub fn insert(&mut self, key: K, value: V) -> Option<V>
pub fn insert(&mut self, key: K, value: V) -> Option<V>
Delegates to upstream BTreeMap::insert with the governed allocation.
Sourcepub fn get(&self, key: &K) -> Option<V>
pub fn get(&self, key: &K) -> Option<V>
Delegates to upstream BTreeMap::get with the governed allocation.
Sourcepub fn contains_key(&self, key: &K) -> bool
pub fn contains_key(&self, key: &K) -> bool
Delegates to upstream BTreeMap::contains_key with the governed allocation.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Delegates to upstream BTreeMap::is_empty with the governed allocation.
Sourcepub fn remove(&mut self, key: &K) -> Option<V>
pub fn remove(&mut self, key: &K) -> Option<V>
Delegates to upstream BTreeMap::remove with the governed allocation.
Sourcepub fn first_key_value(&self) -> Option<(K, V)>
pub fn first_key_value(&self) -> Option<(K, V)>
Delegates to upstream BTreeMap::first_key_value with the governed allocation.
Sourcepub fn last_key_value(&self) -> Option<(K, V)>
pub fn last_key_value(&self) -> Option<(K, V)>
Delegates to upstream BTreeMap::last_key_value with the governed allocation.
Sourcepub fn pop_first(&mut self) -> Option<(K, V)>
pub fn pop_first(&mut self) -> Option<(K, V)>
Delegates to upstream BTreeMap::pop_first with the governed allocation.
Sourcepub fn pop_last(&mut self) -> Option<(K, V)>
pub fn pop_last(&mut self) -> Option<(K, V)>
Delegates to upstream BTreeMap::pop_last with the governed allocation.
Sourcepub fn iter(&self) -> MapIter<'_, K, V, M>
pub fn iter(&self) -> MapIter<'_, K, V, M>
Delegates to upstream BTreeMap::iter with the governed allocation.
Sourcepub fn range(&self, key_range: impl RangeBounds<K>) -> MapIter<'_, K, V, M>
pub fn range(&self, key_range: impl RangeBounds<K>) -> MapIter<'_, K, V, M>
Delegates to upstream BTreeMap::range with the governed allocation.
Sourcepub fn keys(&self) -> impl DoubleEndedIterator<Item = K> + '_
pub fn keys(&self) -> impl DoubleEndedIterator<Item = K> + '_
Delegates to upstream BTreeMap::keys with the governed allocation.
Sourcepub fn values(&self) -> impl DoubleEndedIterator<Item = V> + '_
pub fn values(&self) -> impl DoubleEndedIterator<Item = V> + '_
Delegates to upstream BTreeMap::values with the governed allocation.