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>
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.
Trait Implementations§
impl<K, V, A> Send for RbTreeMap<K, V, A>
impl<K, V, A> Sync for RbTreeMap<K, V, A>
Auto Trait Implementations§
impl<K, V, A> Freeze for RbTreeMap<K, V, A>where
A: Freeze,
impl<K, V, A> RefUnwindSafe for RbTreeMap<K, V, A>
impl<K, V, A> Unpin for RbTreeMap<K, V, A>
impl<K, V, A> UnwindSafe for RbTreeMap<K, V, A>
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