pub enum Node<T>where
T: PathTreeTypes,{
Inner(InnerNode<T>),
Leaf(LeafNode<T::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 ExactSizeIterator<Item = HalfEdge<'_, T>> + '_
pub fn children(&self) -> impl ExactSizeIterator<Item = HalfEdge<'_, T>> + '_
Returns an iterator over all children of this node
Only includes direct children, not grandchildren or other descendants.
Sourcepub fn children_count(&self) -> usize
pub fn children_count(&self) -> usize
Returns the number of children.
Only includes direct children, not grandchildren or other descendants.
In constant time, i.e. O(1).
Sourcepub fn find_child(
&self,
child_path_segment: &T::PathSegment,
) -> Option<T::NodeId>
pub fn find_child( &self, child_path_segment: &T::PathSegment, ) -> Option<T::NodeId>
Find a child node by its path segment.
Returns the id of the child node or None
if not found.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Node<T>
impl<T> RefUnwindSafe for Node<T>where
<T as PathTreeTypes>::InnerValue: RefUnwindSafe,
<T as PathTreeTypes>::LeafValue: RefUnwindSafe,
<T as PathTreeTypes>::PathSegmentOwned: RefUnwindSafe,
<T as PathTreeTypes>::NodeId: RefUnwindSafe,
impl<T> Send for Node<T>where
<T as PathTreeTypes>::InnerValue: Send,
<T as PathTreeTypes>::LeafValue: Send,
<T as PathTreeTypes>::PathSegmentOwned: Sync + Send,
<T as PathTreeTypes>::NodeId: Sync + Send,
impl<T> Sync for Node<T>where
<T as PathTreeTypes>::InnerValue: Sync,
<T as PathTreeTypes>::LeafValue: Sync,
<T as PathTreeTypes>::PathSegmentOwned: Sync + Send,
<T as PathTreeTypes>::NodeId: Sync + Send,
impl<T> Unpin for Node<T>where
<T as PathTreeTypes>::InnerValue: Unpin,
<T as PathTreeTypes>::LeafValue: Unpin,
<T as PathTreeTypes>::PathSegmentOwned: Unpin,
<T as PathTreeTypes>::NodeId: Unpin,
impl<T> UnwindSafe for Node<T>where
<T as PathTreeTypes>::InnerValue: UnwindSafe,
<T as PathTreeTypes>::LeafValue: UnwindSafe,
<T as PathTreeTypes>::PathSegmentOwned: RefUnwindSafe + UnwindSafe,
<T as PathTreeTypes>::NodeId: RefUnwindSafe + 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more