pub struct TreeNode<T> { /* private fields */ }Expand description
One owned value and its recursive child nodes.
Implementations§
Source§impl<T> TreeNode<T>
impl<T> TreeNode<T>
Sourcepub fn children<I, N>(self, children: I) -> Selfwhere
I: IntoIterator<Item = N>,
N: Into<Self>,
pub fn children<I, N>(self, children: I) -> Selfwhere
I: IntoIterator<Item = N>,
N: Into<Self>,
Appends child nodes in iteration order.
Includes or excludes this node and all of its descendants.
Sourcepub const fn child_offset(self, start: usize, end: usize) -> Self
pub const fn child_offset(self, start: usize, end: usize) -> Self
Omits start children from the front and end from the back.
Sourcepub fn child_nodes(&self) -> &[Self]
pub fn child_nodes(&self) -> &[Self]
Returns all owned children before visibility and offset are applied.
Returns whether this node and its descendants are excluded.
Trait Implementations§
Source§impl<T: PartialEq> PartialEq for TreeNode<T>
impl<T: PartialEq> PartialEq for TreeNode<T>
impl<T: Eq> Eq for TreeNode<T>
impl<T> StructuralPartialEq for TreeNode<T>
Auto Trait Implementations§
impl<T> Freeze for TreeNode<T>where
T: Freeze,
impl<T> RefUnwindSafe for TreeNode<T>where
T: RefUnwindSafe,
impl<T> Send for TreeNode<T>where
T: Send,
impl<T> Sync for TreeNode<T>where
T: Sync,
impl<T> Unpin for TreeNode<T>where
T: Unpin,
impl<T> UnsafeUnpin for TreeNode<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for TreeNode<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