Skip to main content

Search

Trait Search 

Source
pub trait Search<'a> {
    // Required methods
    fn act_on_node(&self, action: &mut dyn FnMut(&Node<'a>, Ancestors<'a, '_>));
    fn first_child(&self, pred: fn(u16) -> bool) -> Option<Node<'a>>;
    fn act_on_child(&self, action: &mut dyn FnMut(&Node<'a>));
}
Expand description

Subtree traversal helpers implemented by Node.

Required Methods§

Source

fn act_on_node(&self, action: &mut dyn FnMut(&Node<'a>, Ancestors<'a, '_>))

Visits every node of the subtree in source order, handing the action each node’s ancestor chain alongside it so a predicate it applies stays off Node::parent (#1088).

Source

fn first_child(&self, pred: fn(u16) -> bool) -> Option<Node<'a>>

The first direct child whose kind_id satisfies pred.

Source

fn act_on_child(&self, action: &mut dyn FnMut(&Node<'a>))

Visits each direct child in source order.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a> Search<'a> for Node<'a>