Trait rustc_middle::ty::visit::TypeVisitor
source · pub trait TypeVisitor<'tcx>: Sized {
type BreakTy = !;
fn visit_binder<T: TypeVisitable<'tcx>>(
&mut self,
t: &Binder<'tcx, T>
) -> ControlFlow<Self::BreakTy> { ... }
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> { ... }
fn visit_region(&mut self, r: Region<'tcx>) -> ControlFlow<Self::BreakTy> { ... }
fn visit_const(&mut self, c: Const<'tcx>) -> ControlFlow<Self::BreakTy> { ... }
fn visit_predicate(
&mut self,
p: Predicate<'tcx>
) -> ControlFlow<Self::BreakTy> { ... }
}
Expand description
This trait is implemented for every visiting traversal. There is a visit method defined for every type of interest. Each such method has a default that recurses into the type’s fields in a non-custom fashion.