pub struct NodeIndex(pub usize);
Expand description
Wrapper around indices to the collection of nodes inside a Tree
.
Tuple Fields
0: usize
Implementations
sourceimpl NodeIndex
impl NodeIndex
sourcepub const fn right(self) -> Self
pub const fn right(self) -> Self
Returns the index of the node to the right of the current one.
sourcepub const fn parent(self) -> Option<Self>
pub const fn parent(self) -> Option<Self>
Returns the index of the parent node or None
if current node is the root.
sourcepub const fn level(self) -> usize
pub const fn level(self) -> usize
Returns the number of nodes leading from the root to the current node, including self
.
Trait Implementations
sourceimpl PartialEq<NodeIndex> for NodeIndex
impl PartialEq<NodeIndex> for NodeIndex
impl Copy for NodeIndex
impl Eq for NodeIndex
impl StructuralEq for NodeIndex
impl StructuralPartialEq for NodeIndex
Auto Trait Implementations
impl RefUnwindSafe for NodeIndex
impl Send for NodeIndex
impl Sync for NodeIndex
impl Unpin for NodeIndex
impl UnwindSafe for NodeIndex
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more