pub trait Traversion<'a, S: Copy + ?Sized> {
    fn path_push(&mut self, elem: &'a Element);
    fn path_pop(&mut self) -> Option<&'a Element>;
    fn get_path(&self) -> &Vec<&'a Element>;

    fn work(
        &mut self,
        _root: &'a Element,
        _settings: S,
        _out: &mut dyn Write
    ) -> Result<bool> { ... } fn work_vec(
        &mut self,
        _root: &'a [Element],
        _settings: S,
        _out: &mut dyn Write
    ) -> Result<bool> { ... } fn run_vec(
        &mut self,
        content: &'a [Element],
        settings: S,
        out: &mut dyn Write
    ) -> Result<()> { ... } fn run(
        &mut self,
        root: &'a Element,
        settings: S,
        out: &mut dyn Write
    ) -> Result<()> { ... } }
Expand description

Implements a traversion over a tree of Element.

All fields of the traversion struct can be mutated, external settings cannot.

Required Methods§

push to the traversion path.

pop from the traversion path.

get the traversion path.

Provided Methods§

template method for handling single nodes. if the result is false, handling is complete and children of this node are not considered, otherwise work() is recursively called for all children.

template method for handling a vector of nodes. if the result is false, handling is complete and children of the vector’s elements are not considered, otherwise work() is recursively called for all children.

run this traversion for a vector of elements.

run this traversion for an element.

Implementors§