pub struct Node<T> {
pub value: T,
pub children: Vec<Node<T>>,
}
Expand description
Represents the minimum unit in a tree, containing a value of type T and all those nodes children of the node itself, if any.
Fields§
§value: T
§children: Vec<Node<T>>
Implementations§
Source§impl<'a, T> Node<T>
impl<'a, T> Node<T>
Sourcepub fn traverse(&'a self) -> Traverse<'a, T, Synchronous>
pub fn traverse(&'a self) -> Traverse<'a, T, Synchronous>
Returns a synchronous instance of Traverse for the given reference of node.
Sourcepub fn traverse_mut(&'a mut self) -> TraverseMut<'a, T, Synchronous>
pub fn traverse_mut(&'a mut self) -> TraverseMut<'a, T, Synchronous>
Returns a synchronous instance of TraverseMut for the given mutable reference of node.
Sourcepub fn into_traverse(self) -> TraverseOwned<T, Synchronous>
pub fn into_traverse(self) -> TraverseOwned<T, Synchronous>
Returns a synchronous instance of TraverseOwned owning the given instance of node.
Trait Implementations§
Source§impl<'a, T, S> From<&'a mut Node<T>> for TraverseMut<'a, T, S>
impl<'a, T, S> From<&'a mut Node<T>> for TraverseMut<'a, T, S>
Source§impl<T, S> From<Node<T>> for TraverseOwned<T, S>
impl<T, S> From<Node<T>> for TraverseOwned<T, S>
Auto Trait Implementations§
impl<T> Freeze for Node<T>where
T: Freeze,
impl<T> RefUnwindSafe for Node<T>where
T: RefUnwindSafe,
impl<T> Send for Node<T>where
T: Send,
impl<T> Sync for Node<T>where
T: Sync,
impl<T> Unpin for Node<T>where
T: Unpin,
impl<T> UnwindSafe for Node<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