pub trait Walking:
HasParent<Node = Self>
+ NodeEquality
+ Clone {
// Provided methods
fn depth(&self) -> usize { ... }
fn walk_up(&self, steps: usize) -> Option<Self> { ... }
fn root(&self) -> Self { ... }
fn lca_with(&self, other: &Self) -> Option<Self> { ... }
}Expand description
Defines the walking trait of tree-like structure.
Provided Methods§
Sourcefn depth(&self) -> usize
fn depth(&self) -> usize
Gets the depth of this node in comparison to the root.
§Returns
The depth of this node in comparison to the root.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.