Trait rosary::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.

Implementors§

source§

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