pub trait TreeHelper {
    // Required methods
    fn get_element(&self, node_id: &NodeId) -> ∈
    fn get_element_mut(&mut self, node_id: &NodeId) -> &mut Element;
    fn get_parent(&self, child: &NodeId) -> ∈
    fn get_parent_mut(&mut self, child: &NodeId) -> &mut Element;
    fn get_parent_id(&self, child: &NodeId) -> &NodeId;
    fn splice_subtree(
        &mut self,
        parent_id: &NodeId,
        other: &Tree<Element>,
        other_id: &NodeId,
        order: CreateOrder,
    ) -> NodeId;
    fn write_formatted_names<W: Write>(&self, w: &mut W) -> Result;
}Expand description
Utility functions to extend the Tree interface for common operations.
Required Methods§
fn get_element(&self, node_id: &NodeId) -> &Element
fn get_element_mut(&mut self, node_id: &NodeId) -> &mut Element
fn get_parent(&self, child: &NodeId) -> &Element
fn get_parent_mut(&mut self, child: &NodeId) -> &mut Element
fn get_parent_id(&self, child: &NodeId) -> &NodeId
Sourcefn splice_subtree(
    &mut self,
    parent_id: &NodeId,
    other: &Tree<Element>,
    other_id: &NodeId,
    order: CreateOrder,
) -> NodeId
 
fn splice_subtree( &mut self, parent_id: &NodeId, other: &Tree<Element>, other_id: &NodeId, order: CreateOrder, ) -> NodeId
Splice the subtree of other rooted at other_id into tree under
parent_id with the given order
Sourcefn write_formatted_names<W: Write>(&self, w: &mut W) -> Result
 
fn write_formatted_names<W: Write>(&self, w: &mut W) -> Result
Write formatted tree representation showing only the names of the nodes
(as opposed to the default Tree::write_formatted method).
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.