pub struct Node {
pub id: usize,
pub children: Vec<Node>,
}
Expand description
Representation of a tree node, which has an id
and a Vec
of children
.
children
is empty if the node does not have children.
Fields§
§id: usize
§children: Vec<Node>
Implementations§
Source§impl Node
impl Node
pub fn from_adjacency_list(graph: &UnweightedAdjacencyList, root: usize) -> Self
Trait Implementations§
impl Eq for Node
impl StructuralPartialEq for Node
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnwindSafe for Node
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.