pub struct Node { /* private fields */ }Implementations§
Source§impl Node
impl Node
pub fn idx(&self) -> usize
Sourcepub fn internal_idx(&self) -> usize
pub fn internal_idx(&self) -> usize
The index among internal nodes, starting after the leaves
Panics if this node is a leaf node, if Node::is_leaf returns true.
pub fn parent(&self) -> Option<usize>
pub fn children(&self) -> impl Iterator<Item = usize>
Sourcepub fn internal_level(&self) -> usize
pub fn internal_level(&self) -> usize
The internal level of the node in the tree
Panics if this node is a leaf node, if Node::is_leaf returns true.
Returns 0 for a node that has leaves as children
Sourcepub fn leaves(&self) -> impl Iterator<Item = usize> + Clone
pub fn leaves(&self) -> impl Iterator<Item = usize> + Clone
An iterator over all leaf indices under this node.
pub fn is_leaf(&self) -> bool
pub fn is_root(&self) -> bool
Trait Implementations§
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