pub trait TypeVisitor<I: Interner>: Sized {
    type BreakTy = !;

    // Provided methods
    fn visit_binder<T: TypeVisitable<I>>(
        &mut self,
        t: &I::Binder<T>
    ) -> ControlFlow<Self::BreakTy>
       where I::Binder<T>: TypeSuperVisitable<I> { ... }
    fn visit_ty(&mut self, t: I::Ty) -> ControlFlow<Self::BreakTy>
       where I::Ty: TypeSuperVisitable<I> { ... }
    fn visit_region(&mut self, _r: I::Region) -> ControlFlow<Self::BreakTy> { ... }
    fn visit_const(&mut self, c: I::Const) -> ControlFlow<Self::BreakTy>
       where I::Const: TypeSuperVisitable<I> { ... }
    fn visit_predicate(&mut self, p: I::Predicate) -> ControlFlow<Self::BreakTy>
       where I::Predicate: TypeSuperVisitable<I> { ... }
}
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§

source

fn visit_binder<T: TypeVisitable<I>>( &mut self, t: &I::Binder<T> ) -> ControlFlow<Self::BreakTy>where I::Binder<T>: TypeSuperVisitable<I>,

source

fn visit_ty(&mut self, t: I::Ty) -> ControlFlow<Self::BreakTy>where I::Ty: TypeSuperVisitable<I>,

source

fn visit_region(&mut self, _r: I::Region) -> ControlFlow<Self::BreakTy>

source

fn visit_const(&mut self, c: I::Const) -> ControlFlow<Self::BreakTy>where I::Const: TypeSuperVisitable<I>,

source

fn visit_predicate(&mut self, p: I::Predicate) -> ControlFlow<Self::BreakTy>where I::Predicate: TypeSuperVisitable<I>,

Implementors§

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

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

impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for ImplTraitInTraitCollector<'tcx>

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

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

impl<'a, 'tcx> TypeVisitor<TyCtxt<'tcx>> for UnresolvedTypeOrConstFinder<'a, 'tcx>

impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for MaxUniverse

impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for IsSuggestableVisitor<'tcx>

impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for HasTypeFlagsVisitor

impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for ValidateBoundVars<'tcx>

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

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

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

impl<'tcx, F, E> TypeVisitor<TyCtxt<'tcx>> for OrphanChecker<'tcx, F>where F: FnMut(Ty<'tcx>) -> Result<Ty<'tcx>, E>,

impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for ImplTraitInTraitFinder<'_, 'tcx>

impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for OpaqueTypeCollector<'tcx>