pub trait TypeVisitable<I: Interner>: Debug + Clone {
    // Required method
    fn visit_with<V: TypeVisitor<I>>(&self, visitor: &mut V) -> V::Result;
}
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) -> V::Result

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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

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

source§

fn visit_with<F: TypeVisitor<I>>(&self, _: &mut F) -> F::Result

source§

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

source§

fn visit_with<F: TypeVisitor<I>>(&self, _: &mut F) -> F::Result

source§

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

source§

fn visit_with<F: TypeVisitor<I>>(&self, _: &mut F) -> F::Result

source§

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

source§

fn visit_with<F: TypeVisitor<I>>(&self, _: &mut F) -> F::Result

source§

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

source§

fn visit_with<F: TypeVisitor<I>>(&self, _: &mut F) -> F::Result

source§

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

source§

fn visit_with<F: TypeVisitor<I>>(&self, _: &mut F) -> F::Result

source§

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

source§

fn visit_with<F: TypeVisitor<I>>(&self, _: &mut F) -> F::Result

source§

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

source§

fn visit_with<F: TypeVisitor<I>>(&self, _: &mut F) -> F::Result

source§

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

source§

fn visit_with<F: TypeVisitor<I>>(&self, _: &mut F) -> F::Result

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) -> V::Result

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

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) -> V::Result

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) -> V::Result

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) -> V::Result

Implementors§