Struct tree_layout::TreeNode
source · pub struct TreeNode<D> {
pub data: D,
pub order: usize,
pub depth: usize,
pub parent: Option<usize>,
pub children: Vec<usize>,
}
Fields§
§data: D
Data needed by the actual algorithm.
order: usize
The position of this node among it’s siblings.
Can also be thought of as the number of left-siblings this node has.
depth: usize
The depth of this node.
Can be thought of as the number of edges between this node and the root node.
parent: Option<usize>
The index into Tree
of this node’s parent.
children: Vec<usize>
The indices into Tree
of this node’s children.
Implementations§
Trait Implementations§
source§impl<D: PartialEq> PartialEq for TreeNode<D>
impl<D: PartialEq> PartialEq for TreeNode<D>
impl<D: Eq> Eq for TreeNode<D>
impl<D> StructuralEq for TreeNode<D>
impl<D> StructuralPartialEq for TreeNode<D>
Auto Trait Implementations§
impl<D> RefUnwindSafe for TreeNode<D>where D: RefUnwindSafe,
impl<D> Send for TreeNode<D>where D: Send,
impl<D> Sync for TreeNode<D>where D: Sync,
impl<D> Unpin for TreeNode<D>where D: Unpin,
impl<D> UnwindSafe for TreeNode<D>where D: 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