pub struct RbTreeMap<K, V, A>where
A: Allocator,{ /* private fields */ }
Expand description
A map type based on the ngx_rbtree_t
.
This map implementation owns the stored keys and values and ensures that the data is dropped. The order of the elements is an undocumented implementation detail.
This is a ngx
-specific high-level type with no direct counterpart in the NGINX code.
Implementations§
Source§impl<K, V, A> RbTreeMap<K, V, A>where
A: Allocator,
impl<K, V, A> RbTreeMap<K, V, A>where
A: Allocator,
Sourcepub fn iter_mut(&mut self) -> MapIterMut<'_, K, V> ⓘ
pub fn iter_mut(&mut self) -> MapIterMut<'_, K, V> ⓘ
Returns a mutable iterator over the entries of the tree.
Source§impl<K, V, A> RbTreeMap<K, V, A>
impl<K, V, A> RbTreeMap<K, V, A>
Sourcepub fn try_new_in(alloc: A) -> Result<Self, AllocError>
pub fn try_new_in(alloc: A) -> Result<Self, AllocError>
Attempts to create and initialize a new RbTreeMap with specified allocator.
Sourcepub fn get<Q>(&self, key: &Q) -> Option<&V>
pub fn get<Q>(&self, key: &Q) -> Option<&V>
Returns a reference to the value corresponding to the key.
Sourcepub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
Returns a mutable reference to the value corresponding to the key.
Sourcepub fn remove<Q>(&mut self, key: &Q) -> Option<V>
pub fn remove<Q>(&mut self, key: &Q) -> Option<V>
Removes a key from the tree, returning the value at the key if the key was previously in the tree.
Sourcepub fn remove_entry<Q>(&mut self, key: &Q) -> Option<(K, V)>
pub fn remove_entry<Q>(&mut self, key: &Q) -> Option<(K, V)>
Removes a key from the tree, returning the stored key and value if the key was previously in the tree.
Sourcepub fn try_insert(&mut self, key: K, value: V) -> Result<&mut V, AllocError>
pub fn try_insert(&mut self, key: K, value: V) -> Result<&mut V, AllocError>
Attempts to insert a new element into the tree.