pub struct Tree<T> { /* private fields */ }
Expand description
Vec-backed ID-tree.
Always contains at least a root node.
Implementations
sourceimpl<T> Tree<T>
impl<T> Tree<T>
sourcepub fn values(&self) -> Values<'_, T>ⓘNotable traits for Values<'a, T>impl<'a, T: 'a> Iterator for Values<'a, T> type Item = &'a T;
pub fn values(&self) -> Values<'_, T>ⓘNotable traits for Values<'a, T>impl<'a, T: 'a> Iterator for Values<'a, T> type Item = &'a T;
Returns an iterator over values in insert order.
sourceimpl<T> Tree<T>
impl<T> Tree<T>
sourcepub fn with_capacity(root: T, capacity: usize) -> Self
pub fn with_capacity(root: T, capacity: usize) -> Self
Creates a tree with a root node and the specified capacity.
sourcepub fn get(&self, id: NodeId) -> Option<NodeRef<'_, T>>
pub fn get(&self, id: NodeId) -> Option<NodeRef<'_, T>>
Returns a reference to the specified node.
sourcepub fn get_mut(&mut self, id: NodeId) -> Option<NodeMut<'_, T>>
pub fn get_mut(&mut self, id: NodeId) -> Option<NodeMut<'_, T>>
Returns a mutator of the specified node.
sourcepub unsafe fn get_unchecked(&self, id: NodeId) -> NodeRef<'_, T>
pub unsafe fn get_unchecked(&self, id: NodeId) -> NodeRef<'_, T>
Returns a reference to the specified node.
sourcepub unsafe fn get_unchecked_mut(&mut self, id: NodeId) -> NodeMut<'_, T>
pub unsafe fn get_unchecked_mut(&mut self, id: NodeId) -> NodeMut<'_, T>
Returns a mutator of the specified node.
Trait Implementations
sourceimpl<T> IntoIterator for Tree<T>
impl<T> IntoIterator for Tree<T>
impl<T: Eq> Eq for Tree<T>
impl<T> StructuralEq for Tree<T>
impl<T> StructuralPartialEq for Tree<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Tree<T>where
T: RefUnwindSafe,
impl<T> Send for Tree<T>where
T: Send,
impl<T> Sync for Tree<T>where
T: Sync,
impl<T> Unpin for Tree<T>where
T: Unpin,
impl<T> UnwindSafe for Tree<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more