pub struct InnerOccupiedEntry<'a, K, V, const PREFIX_LEN: usize = DEFAULT_PREFIX_LEN, A: Allocator = Global> {
pub(crate) map: &'a mut TreeMap<K, V, PREFIX_LEN, A>,
pub(crate) key: K,
pub(crate) overwrite_point: OverwritePoint<K, V, PREFIX_LEN>,
}Expand description
A view into an occupied subtree in a TreeMap.
It is part of the PrefixOccupied enum.
Fields§
§map: &'a mut TreeMap<K, V, PREFIX_LEN, A>§key: K§overwrite_point: OverwritePoint<K, V, PREFIX_LEN>Implementations§
Source§impl<'a, K, V, const PREFIX_LEN: usize, A: Allocator> InnerOccupiedEntry<'a, K, V, PREFIX_LEN, A>where
K: AsBytes,
impl<'a, K, V, const PREFIX_LEN: usize, A: Allocator> InnerOccupiedEntry<'a, K, V, PREFIX_LEN, A>where
K: AsBytes,
fn get_leaf(&self) -> Option<NodePtr<PREFIX_LEN, LeafNode<K, V, PREFIX_LEN>>>
Sourcepub fn get(&self) -> Option<&V>
pub fn get(&self) -> Option<&V>
Gets a reference to the underlying value if there is only a singular underlying entry.
Sourcepub fn get_mut(&mut self) -> Option<&mut V>
pub fn get_mut(&mut self) -> Option<&mut V>
Gets a mutable reference to the underlying value if there is only a singular underlying entry.
Sourcepub fn get_key(&self) -> Option<&K>
pub fn get_key(&self) -> Option<&K>
Gets a reference to the underlying key if there is only a singular underlying entry.
Sourcepub fn get_key_value_mut(&mut self) -> Option<(&K, &mut V)>
pub fn get_key_value_mut(&mut self) -> Option<(&K, &mut V)>
Gets a reference to the underlying key and a mutable reference to the value if there is only a singular underlying entry.
Sourcepub fn key(&self) -> &K
pub fn key(&self) -> &K
Returns a reference to the key that will overwrite the underlying entries.
Sourcepub fn iter(&self) -> SubtreeIter<'_, K, V, PREFIX_LEN, A> ⓘ
pub fn iter(&self) -> SubtreeIter<'_, K, V, PREFIX_LEN, A> ⓘ
Returns an iterator over all key value pairs that would be erased upon insertion.
Sourcepub fn iter_mut(&mut self) -> SubtreeIterMut<'_, K, V, PREFIX_LEN, A> ⓘ
pub fn iter_mut(&mut self) -> SubtreeIterMut<'_, K, V, PREFIX_LEN, A> ⓘ
Returns a mutable iterator over all key value pairs that would be erased upon insertion.
Sourcepub fn insert(self, value: V) -> &'a mut V
pub fn insert(self, value: V) -> &'a mut V
Erase the subtree and insert the value with the previously given key in its place.
Sourcepub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V, PREFIX_LEN, A>
pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V, PREFIX_LEN, A>
Erase the subtree and insert the value with the previously given key in its place.
Returns an OccupiedEntry.