/// Walks a `ComponentTree`, doing the operation implemented by `visitor` at each node.
/// If the operation fails at a node, terminates the walk and propagates the error.
Walks a `ComponentTree`, doing the operation implemented by `visitor` at each node.
If the operation fails at a node, terminates the walk and propagates the error.
Walks a ` ComponentTree ` doing the operation implemented by ` visitor ` at each node . If the operation fails at a node terminates the walk and propagates the error .
fn walk<T: ComponentNodeVisitor>(
        &mut self,
        tree: &'a ComponentTree,
        visitor: &mut T,
    ) -> Result<(), anyhow::Error> {
        let mut node = tree.get_root_node()?;
        loop {
            visitor.visit_node(node)?;
            match self.get_next_node(tree)? {
                Some(ref next_node) => {
                    node = next_node;
                }
                None => {
                    return Ok(());
                }
            }
        }
    }
fn walk < T : ComponentNodeVisitor > ( & mut self , tree : & ' a ComponentTree , visitor : & mut T , ) -> Result < ( ) , anyhow :: Error > { let mut node = tree . get_root_node ( ) ? ; loop { visitor . visit_node ( node ) ? ; match self . get_next_node ( tree ) ? { Some ( ref next_node ) => { node = next_node ; } None => { return Ok ( ( ) ) ; } } } }
Walks a `ComponentTree`, doing the operation implemented by `visitor` at each node.
Walks a ` ComponentTree ` doing the operation implemented by ` visitor ` at each node .
&mut self
tree
&'a ComponentTree
visitor
&mut T