pub trait Map: AsRef<Branch> + Sized {
// Provided methods
fn len<T: ReadTxn>(&self, _txn: &T) -> u32 { ... }
fn keys<'a, T: ReadTxn + 'a>(&'a self, txn: &'a T) -> Keys<'a, &'a T, T> ⓘ { ... }
fn values<'a, T: ReadTxn + 'a>(&'a self, txn: &'a T) -> Values<'a, &'a T, T> ⓘ { ... }
fn iter<'a, T: ReadTxn + 'a>(&'a self, txn: &'a T) -> MapIter<'a, &'a T, T> ⓘ { ... }
fn insert<K, V>(
&self,
txn: &mut TransactionMut<'_>,
key: K,
value: V
) -> V::Return
where K: Into<Arc<str>>,
V: Prelim { ... }
fn remove(&self, txn: &mut TransactionMut<'_>, key: &str) -> Option<Value> { ... }
fn get<T: ReadTxn>(&self, txn: &T, key: &str) -> Option<Value> { ... }
fn contains_key<T: ReadTxn>(&self, _txn: &T, key: &str) -> bool { ... }
fn clear(&self, txn: &mut TransactionMut<'_>) { ... }
}
Provided Methods§
sourcefn len<T: ReadTxn>(&self, _txn: &T) -> u32
fn len<T: ReadTxn>(&self, _txn: &T) -> u32
Returns a number of entries stored within current map.
sourcefn keys<'a, T: ReadTxn + 'a>(&'a self, txn: &'a T) -> Keys<'a, &'a T, T> ⓘ
fn keys<'a, T: ReadTxn + 'a>(&'a self, txn: &'a T) -> Keys<'a, &'a T, T> ⓘ
Returns an iterator that enables to traverse over all keys of entries stored within current map. These keys are not ordered.
sourcefn values<'a, T: ReadTxn + 'a>(&'a self, txn: &'a T) -> Values<'a, &'a T, T> ⓘ
fn values<'a, T: ReadTxn + 'a>(&'a self, txn: &'a T) -> Values<'a, &'a T, T> ⓘ
Returns an iterator that enables to traverse over all values stored within current map.
sourcefn iter<'a, T: ReadTxn + 'a>(&'a self, txn: &'a T) -> MapIter<'a, &'a T, T> ⓘ
fn iter<'a, T: ReadTxn + 'a>(&'a self, txn: &'a T) -> MapIter<'a, &'a T, T> ⓘ
Returns an iterator that enables to traverse over all entries - tuple of key-value pairs - stored within current map.
sourcefn insert<K, V>(
&self,
txn: &mut TransactionMut<'_>,
key: K,
value: V
) -> V::Return
fn insert<K, V>( &self, txn: &mut TransactionMut<'_>, key: K, value: V ) -> V::Return
Inserts a new value
under given key
into current map. Returns an integrated value.
sourcefn remove(&self, txn: &mut TransactionMut<'_>, key: &str) -> Option<Value>
fn remove(&self, txn: &mut TransactionMut<'_>, key: &str) -> Option<Value>
Removes a stored within current map under a given key
. Returns that value or None
if
no entry with a given key
was present in current map.
§Removing nested shared types
In case when a nested shared type (eg. MapRef, ArrayRef, TextRef) is being removed, all of its contents will also be deleted recursively. A returned value will contain a reference to a current removed shared type (which will be empty due to all of its elements being deleted), not the content prior the removal.
sourcefn get<T: ReadTxn>(&self, txn: &T, key: &str) -> Option<Value>
fn get<T: ReadTxn>(&self, txn: &T, key: &str) -> Option<Value>
Returns a value stored under a given key
within current map, or None
if no entry
with such key
existed.
sourcefn contains_key<T: ReadTxn>(&self, _txn: &T, key: &str) -> bool
fn contains_key<T: ReadTxn>(&self, _txn: &T, key: &str) -> bool
Checks if an entry with given key
can be found within current map.
sourcefn clear(&self, txn: &mut TransactionMut<'_>)
fn clear(&self, txn: &mut TransactionMut<'_>)
Clears the contents of current map, effectively removing all of its entries.