Visit

Trait Visit 

Source
pub trait Visit<'a, T: ?Sized>: Visitor {
    // Required method
    fn visit(&mut self, _: &'a T) -> ControlFlow<Self::Break>;

    // Provided methods
    fn visit_by_val(self, x: &'a T) -> ControlFlow<Self::Break, Self>
       where Self: Sized { ... }
    fn visit_by_val_infallible(self, x: &'a T) -> Self
       where Self: Visitor<Break = Infallible> + Sized { ... }
}
Expand description

A visitor that can visit a type T.

Required Methods§

Source

fn visit(&mut self, _: &'a T) -> ControlFlow<Self::Break>

Visit this value.

Provided Methods§

Source

fn visit_by_val(self, x: &'a T) -> ControlFlow<Self::Break, Self>
where Self: Sized,

Convenience alias for method chaining.

Source

fn visit_by_val_infallible(self, x: &'a T) -> Self
where Self: Visitor<Break = Infallible> + Sized,

Convenience when the visitor does not return early.

Implementors§