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_unevaluated(
        &mut self,
        uv: Unevaluated<'tcx>
    ) -> ControlFlow<Self::BreakTy> { ... } fn visit_predicate(
        &mut self,
        p: Predicate<'tcx>
    ) -> ControlFlow<Self::BreakTy> { ... } fn visit_mir_const(
        &mut self,
        c: ConstantKind<'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.

Provided Associated Types

Provided Methods

Implementors

impl<'tcx> TypeVisitor<'tcx> for TraitObjectVisitor

impl<'me, 'tcx> TypeVisitor<'tcx> for ScopeInstantiator<'me, 'tcx>

impl<'tcx, OP> TypeVisitor<'tcx> for ConstrainOpaqueTypeRegionVisitor<OP>where
    OP: FnMut(Region<'tcx>),

impl<'a, 'tcx> TypeVisitor<'tcx> for UnresolvedTypeFinder<'a, 'tcx>

impl<'a, 'tcx> TypeVisitor<'tcx> for MarkUsedGenericParams<'a, 'tcx>

impl<'a, 'tcx> TypeVisitor<'tcx> for HasUsedGenericParams<'a>

impl<'tcx, V> TypeVisitor<'tcx> for DefIdVisitorSkeleton<'_, 'tcx, V>where
    V: DefIdVisitor<'tcx> + ?Sized,

impl<'tcx> TypeVisitor<'tcx> for OrphanChecker<'tcx>

impl<'tcx> TypeVisitor<'tcx> for HasNumericInferVisitor

impl<'tcx> TypeVisitor<'tcx> for Search<'tcx>

impl<'tcx> TypeVisitor<'tcx> for BoundVarsCollector<'tcx>

impl<'tcx> TypeVisitor<'tcx> for PlaceholdersCollector

impl<'tcx> TypeVisitor<'tcx> for GATSubstCollector<'tcx>

impl<'tcx> TypeVisitor<'tcx> for ParameterCollector