RoseTree

Trait RoseTree 

Source
pub trait RoseTree<V>: Sized {
    // Required methods
    fn is_leaf(&self) -> bool;
    fn is_branch(&self) -> bool;
    fn size(&self) -> usize;
    fn destructure(self) -> (V, Vec<Self>);
    fn add_child(self, child: V) -> Self;
}

Required Methods§

Source

fn is_leaf(&self) -> bool

Source

fn is_branch(&self) -> bool

Source

fn size(&self) -> usize

Calculates the number of nodes in the tree.

Source

fn destructure(self) -> (V, Vec<Self>)

Pull a tree apart into its head node, and an iterator over any children.

Source

fn add_child(self, child: V) -> Self

Adds the passed value as a child of self to the structure.

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.

Implementors§

Source§

impl<V> RoseTree<V> for RoseVecTree<V>