pub trait TypeVisitable<I: Interner>: Debug + Clone {
    // Required method
    fn visit_with<V: TypeVisitor<I>>(
        &self,
        visitor: &mut V
    ) -> ControlFlow<V::BreakTy>;
}
Expand description

This trait is implemented for every type that can be visited, providing the skeleton of the traversal.

To implement this conveniently, use the derive macro located in rustc_macros.

Required Methods§

source

fn visit_with<V: TypeVisitor<I>>( &self, visitor: &mut V ) -> ControlFlow<V::BreakTy>

The entry point for visiting. To visit a value t with a visitor v call: t.visit_with(v).

For most types, this just traverses the value, calling visit_with on each field/element.

For types of interest (such as Ty), the implementation of this method that calls a visitor method specifically for that type (such as V::visit_ty). This is where control transfers from TypeVisitable to TypeVisitor.

Implementations on Foreign Types§

source§

impl<I: Interner> TypeVisitable<I> for u16

source§

impl<I: Interner> TypeVisitable<I> for ()

source§

impl<I: Interner, T: TypeVisitable<I>> TypeVisitable<I> for Lrc<T>

source§

fn visit_with<V: TypeVisitor<I>>( &self, visitor: &mut V ) -> ControlFlow<V::BreakTy>

source§

impl<I: Interner, T: TypeVisitable<I>, Ix: Idx> TypeVisitable<I> for IndexVec<Ix, T>

source§

fn visit_with<V: TypeVisitor<I>>( &self, visitor: &mut V ) -> ControlFlow<V::BreakTy>

source§

impl<I: Interner, T: TypeVisitable<I>> TypeVisitable<I> for Box<T>

source§

fn visit_with<V: TypeVisitor<I>>( &self, visitor: &mut V ) -> ControlFlow<V::BreakTy>

source§

impl<I: Interner, T: TypeVisitable<I>, E: TypeVisitable<I>> TypeVisitable<I> for Result<T, E>

source§

fn visit_with<V: TypeVisitor<I>>( &self, visitor: &mut V ) -> ControlFlow<V::BreakTy>

source§

impl<I: Interner> TypeVisitable<I> for String

source§

impl<I: Interner, T: TypeVisitable<I>, U: TypeVisitable<I>> TypeVisitable<I> for (T, U)

source§

fn visit_with<V: TypeVisitor<I>>( &self, visitor: &mut V ) -> ControlFlow<V::BreakTy>

source§

impl<I: Interner> TypeVisitable<I> for u64

source§

impl<I: Interner> TypeVisitable<I> for bool

source§

impl<I: Interner, T: TypeVisitable<I>> TypeVisitable<I> for Vec<T>

source§

fn visit_with<V: TypeVisitor<I>>( &self, visitor: &mut V ) -> ControlFlow<V::BreakTy>

source§

impl<I: Interner, T: TypeVisitable<I>> TypeVisitable<I> for Option<T>

source§

fn visit_with<V: TypeVisitor<I>>( &self, visitor: &mut V ) -> ControlFlow<V::BreakTy>

source§

impl<I: Interner> TypeVisitable<I> for u32

source§

impl<I: Interner, A: TypeVisitable<I>, B: TypeVisitable<I>, C: TypeVisitable<I>> TypeVisitable<I> for (A, B, C)

source§

fn visit_with<V: TypeVisitor<I>>( &self, visitor: &mut V ) -> ControlFlow<V::BreakTy>

source§

impl<I: Interner, T: TypeVisitable<I>> TypeVisitable<I> for &[T]

source§

fn visit_with<V: TypeVisitor<I>>( &self, visitor: &mut V ) -> ControlFlow<V::BreakTy>

source§

impl<I: Interner> TypeVisitable<I> for usize

Implementors§