Enum im_pathtree::Node
source · pub enum Node<T>where
T: PathTreeTypes,{
Inner(InnerNode<T>),
Leaf(LeafNode<<T as PathTreeTypes>::LeafValue>),
}
Variants§
Implementations§
source§impl<T> Node<T>where
T: PathTreeTypes,
impl<T> Node<T>where
T: PathTreeTypes,
pub const fn inner_value(&self) -> Option<&T::InnerValue>
pub const fn leaf_value(&self) -> Option<&T::LeafValue>
source§impl<T> Node<T>where
T: PathTreeTypes,
impl<T> Node<T>where
T: PathTreeTypes,
sourcepub fn children(&self) -> impl Iterator<Item = HalfEdgeRef<'_, T>> + '_
pub fn children(&self) -> impl Iterator<Item = HalfEdgeRef<'_, T>> + '_
Returns an iterator over all children of this node
Only includes direct children, not grandchildren or other descendants.
sourcepub fn descendants<'a>(
&'a self,
tree: &'a PathTree<T>
) -> DepthFirstDescendantsIter<'a, T> ⓘ
pub fn descendants<'a>( &'a self, tree: &'a PathTree<T> ) -> DepthFirstDescendantsIter<'a, T> ⓘ
Returns an iterator over all descendants of this node
Recursively traverse the subtree.
The ordering of nodes is undefined and an implementation detail. Only parent nodes are guaranteed to be visited before their children.
pub fn count_descendants<'a>(&'a self, tree: &'a PathTree<T>) -> usize
Trait Implementations§
source§impl<T> From<LeafNode<<T as PathTreeTypes>::LeafValue>> for Node<T>where
T: PathTreeTypes,
impl<T> From<LeafNode<<T as PathTreeTypes>::LeafValue>> for Node<T>where
T: PathTreeTypes,
Auto Trait Implementations§
impl<T> RefUnwindSafe for Node<T>where
<T as PathTreeTypes>::InnerValue: RefUnwindSafe,
<T as PathTreeTypes>::LeafValue: RefUnwindSafe,
<T as PathTreeTypes>::PathSegment: RefUnwindSafe,
impl<T> Send for Node<T>where
<T as PathTreeTypes>::InnerValue: Send,
<T as PathTreeTypes>::LeafValue: Send,
<T as PathTreeTypes>::PathSegment: Send + Sync,
impl<T> Sync for Node<T>where
<T as PathTreeTypes>::InnerValue: Sync,
<T as PathTreeTypes>::LeafValue: Sync,
<T as PathTreeTypes>::PathSegment: Send + Sync,
impl<T> Unpin for Node<T>where
<T as PathTreeTypes>::InnerValue: Unpin,
<T as PathTreeTypes>::LeafValue: Unpin,
<T as PathTreeTypes>::PathSegment: Unpin,
impl<T> UnwindSafe for Node<T>where
<T as PathTreeTypes>::InnerValue: UnwindSafe,
<T as PathTreeTypes>::LeafValue: UnwindSafe,
<T as PathTreeTypes>::PathSegment: UnwindSafe + RefUnwindSafe,
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