pub struct NgxRbTree<T> { /* private fields */ }
Expand description
A wrapper over a raw ngx_rbtree_t
, a red-black tree implementation.
This wrapper is defined in terms of type T
that embeds and can be converted from or to the
tree nodes.
See https://nginx.org/en/docs/dev/development_guide.html#red_black_tree.
Implementations§
Source§impl<T> NgxRbTree<T>where
T: NgxRbTreeEntry,
impl<T> NgxRbTree<T>where
T: NgxRbTreeEntry,
Sourcepub unsafe fn from_ptr<'a>(tree: *const ngx_rbtree_t) -> &'a Self
pub unsafe fn from_ptr<'a>(tree: *const ngx_rbtree_t) -> &'a Self
Creates a tree reference from a pointer to ngx_rbtree_t.
§Safety
tree
is a valid pointer to ngx_rbtree_t, and T::from_rbtree_node
on the tree nodes
results in valid pointers to T
.
Sourcepub unsafe fn from_ptr_mut<'a>(tree: *mut ngx_rbtree_t) -> &'a mut Self
pub unsafe fn from_ptr_mut<'a>(tree: *mut ngx_rbtree_t) -> &'a mut Self
Creates a mutable tree reference from a pointer to ngx_rbtree_t.
§Safety
tree
is a valid pointer to ngx_rbtree_t, and T::from_rbtree_node
on the tree nodes
results in valid pointers to T
.
Sourcepub fn iter(&self) -> NgxRbTreeIter<'_> ⓘ
pub fn iter(&self) -> NgxRbTreeIter<'_> ⓘ
Returns an iterator over the nodes of the tree.
Sourcepub fn iter_mut(&mut self) -> NgxRbTreeIter<'_> ⓘ
pub fn iter_mut(&mut self) -> NgxRbTreeIter<'_> ⓘ
Returns a mutable iterator over the nodes of the tree.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for NgxRbTree<T>
impl<T> RefUnwindSafe for NgxRbTree<T>where
T: RefUnwindSafe,
impl<T> !Send for NgxRbTree<T>
impl<T> !Sync for NgxRbTree<T>
impl<T> Unpin for NgxRbTree<T>where
T: Unpin,
impl<T> UnwindSafe for NgxRbTree<T>where
T: UnwindSafe,
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