Trait repc_impl::visitor::Visitor[][src]

pub trait Visitor<I: Layout> {
    fn visit_type(&mut self, ty: &Type<I>) { ... }
fn visit_annotations(&mut self, annotations: &[Annotation]) { ... }
fn visit_builtin_type(&mut self, builtin_type: BuiltinType, ty: &Type<I>) { ... }
fn visit_record(&mut self, record: &Record<I>, ty: &Type<I>) { ... }
fn visit_record_field(
        &mut self,
        field: &RecordField<I>,
        record: &Record<I>,
        ty: &Type<I>
    ) { ... }
fn visit_typedef(&mut self, dst: &Type<I>, ty: &Type<I>) { ... }
fn visit_array(&mut self, array: &Array<I>, ty: &Type<I>) { ... }
fn visit_opaque_type(&mut self, layout: I::OpaqueLayout, ty: &Type<I>) { ... }
fn visit_enum(&mut self, variants: &[i128], ty: &Type<I>) { ... } }
Expand description

This trait represents a visitor that walks through a Type.

Each method’s default implementation is accessible through the function of the same name in the visitor module.

Example

struct Impl;

impl<I: Layout> Visitor<I> for Impl {
    fn visit_enum(&mut self, variants: &[i128], ty: &Type<I>) {
        println!("Variants: {:?}", variants);
        visit_enum(self, variants, ty)
    }
}

Provided methods

Called for types.

Called for the annotations on a type or field.

Called for builtin types.

Called for records.

Called for record fields.

Called for typedefs.

Called for arrays.

Called for opaque types.

Called for enums.

Implementors