pub struct InnerNode<T>where
T: PathTreeTypes,{
pub value: T::InnerValue,
/* private fields */
}
Expand description
Intrinsic data of an inner node.
Fields§
§value: T::InnerValue
Implementations§
Source§impl<T> InnerNode<T>where
T: PathTreeTypes,
impl<T> InnerNode<T>where
T: PathTreeTypes,
Sourcepub fn children(&self) -> impl ExactSizeIterator<Item = HalfEdge<'_, T>> + '_
pub fn children(&self) -> impl ExactSizeIterator<Item = HalfEdge<'_, T>> + '_
Edges to children of this node
In arbitrary but stable ordering.
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.
Sourcepub fn descendants_count<'a>(&'a self, tree: &'a PathTree<T>) -> usize
pub fn descendants_count<'a>(&'a self, tree: &'a PathTree<T>) -> usize
Number of descendants of this node
Recursively counts all descendants of this node.
More efficient than descendants().count()
.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for InnerNode<T>
impl<T> RefUnwindSafe for InnerNode<T>where
<T as PathTreeTypes>::InnerValue: RefUnwindSafe,
<T as PathTreeTypes>::PathSegmentOwned: RefUnwindSafe,
<T as PathTreeTypes>::NodeId: RefUnwindSafe,
impl<T> Send for InnerNode<T>where
<T as PathTreeTypes>::InnerValue: Send,
<T as PathTreeTypes>::PathSegmentOwned: Sync + Send,
<T as PathTreeTypes>::NodeId: Sync + Send,
impl<T> Sync for InnerNode<T>where
<T as PathTreeTypes>::InnerValue: Sync,
<T as PathTreeTypes>::PathSegmentOwned: Sync + Send,
<T as PathTreeTypes>::NodeId: Sync + Send,
impl<T> Unpin for InnerNode<T>where
<T as PathTreeTypes>::InnerValue: Unpin,
<T as PathTreeTypes>::PathSegmentOwned: Unpin,
<T as PathTreeTypes>::NodeId: Unpin,
impl<T> UnwindSafe for InnerNode<T>where
<T as PathTreeTypes>::InnerValue: 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