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§
Sourcefn visit(&mut self, _: &'a T) -> ControlFlow<Self::Break>
fn visit(&mut self, _: &'a T) -> ControlFlow<Self::Break>
Visit this value.
Provided Methods§
Sourcefn visit_by_val(self, x: &'a T) -> ControlFlow<Self::Break, Self>where
Self: Sized,
fn visit_by_val(self, x: &'a T) -> ControlFlow<Self::Break, Self>where
Self: Sized,
Convenience alias for method chaining.
Sourcefn visit_by_val_infallible(self, x: &'a T) -> Self
fn visit_by_val_infallible(self, x: &'a T) -> Self
Convenience when the visitor does not return early.