Trait wasmbin::visit::Visit

source ·
pub trait Visit: 'static + Sized {
    // Provided methods
    fn visit<'a, T: 'static, R: VisitResult, F: FnMut(&'a T) -> R>(
        &'a self,
        f: F
    ) -> Result<(), VisitError<R::Error>> { ... }
    fn visit_mut<T: 'static, R: VisitResult, F: FnMut(&mut T) -> R>(
        &mut self,
        f: F
    ) -> Result<(), VisitError<R::Error>> { ... }
    fn visit_children<'a, T: 'static, E, F: FnMut(&'a T) -> Result<(), E>>(
        &'a self,
        _f: &mut F
    ) -> Result<(), VisitError<E>> { ... }
    fn visit_children_mut<T: 'static, E, F: FnMut(&mut T) -> Result<(), E>>(
        &mut self,
        _f: &mut F
    ) -> Result<(), VisitError<E>> { ... }
}
Expand description

A trait for recursively finding instances of a given type within a value.

This is particularly useful for finding and updating indices.

Provided Methods§

source

fn visit<'a, T: 'static, R: VisitResult, F: FnMut(&'a T) -> R>( &'a self, f: F ) -> Result<(), VisitError<R::Error>>

Traverse this value with the provided callback.

source

fn visit_mut<T: 'static, R: VisitResult, F: FnMut(&mut T) -> R>( &mut self, f: F ) -> Result<(), VisitError<R::Error>>

Traverse this value mutably with the provided callback.

source

fn visit_children<'a, T: 'static, E, F: FnMut(&'a T) -> Result<(), E>>( &'a self, _f: &mut F ) -> Result<(), VisitError<E>>

Traverse the children of this value with the provided callback.

source

fn visit_children_mut<T: 'static, E, F: FnMut(&mut T) -> Result<(), E>>( &mut self, _f: &mut F ) -> Result<(), VisitError<E>>

Traverse the children of this value mutably with the provided callback.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Visit for bool

source§

impl Visit for f32

source§

impl Visit for f64

source§

impl Visit for i32

source§

impl Visit for i64

source§

impl Visit for u8

source§

impl Visit for u32

source§

impl Visit for u64

source§

impl Visit for String

source§

impl<T: Visit> Visit for Option<T>

source§

fn visit_children<'a, VisitT: 'static, E, F: FnMut(&'a VisitT) -> Result<(), E>>( &'a self, f: &mut F ) -> Result<(), VisitError<E>>

source§

fn visit_children_mut<VisitT: 'static, E, F: FnMut(&mut VisitT) -> Result<(), E>>( &mut self, f: &mut F ) -> Result<(), VisitError<E>>

source§

impl<T: Visit> Visit for Vec<T>

source§

fn visit_children<'a, VisitT: 'static, E, F: FnMut(&'a VisitT) -> Result<(), E>>( &'a self, f: &mut F ) -> Result<(), VisitError<E>>

source§

fn visit_children_mut<VisitT: 'static, E, F: FnMut(&mut VisitT) -> Result<(), E>>( &mut self, f: &mut F ) -> Result<(), VisitError<E>>

source§

impl<T: Visit, const N: usize> Visit for [T; N]

source§

fn visit_children<'a, VisitT: 'static, E, F: FnMut(&'a VisitT) -> Result<(), E>>( &'a self, f: &mut F ) -> Result<(), VisitError<E>>

source§

fn visit_children_mut<VisitT: 'static, E, F: FnMut(&mut VisitT) -> Result<(), E>>( &mut self, f: &mut F ) -> Result<(), VisitError<E>>

Implementors§

source§

impl Visit for Instruction
where Self: 'static,

source§

impl Visit for Misc
where Self: 'static,

source§

impl Visit for SIMD
where Self: 'static,

source§

impl Visit for Atomic
where Self: 'static,

Available on crate feature threads only.
source§

impl Visit for CustomSection

source§

impl Visit for DataInit
where Self: 'static,

source§

impl Visit for ElemKind
where Self: 'static,

source§

impl Visit for Element
where Self: 'static,

source§

impl Visit for ExportDesc
where Self: 'static,

source§

impl Visit for ImportDesc
where Self: 'static,

source§

impl Visit for NameSubSection
where Self: 'static,

source§

impl Visit for Section
where Self: 'static,

source§

impl Visit for BlockType
where Self: 'static,

source§

impl Visit for RefType
where Self: 'static,

source§

impl Visit for ValueType
where Self: 'static,

source§

impl Visit for UnparsedBytes
where Self: 'static,

source§

impl Visit for DataId
where Self: 'static,

source§

impl Visit for ElemId
where Self: 'static,

source§

impl Visit for ExceptionId
where Self: 'static,

source§

impl Visit for FuncId
where Self: 'static,

source§

impl Visit for GlobalId
where Self: 'static,

source§

impl Visit for LabelId
where Self: 'static,

source§

impl Visit for LocalId
where Self: 'static,

source§

impl Visit for MemId
where Self: 'static,

source§

impl Visit for TableId
where Self: 'static,

source§

impl Visit for TypeId
where Self: 'static,

source§

impl Visit for Catch
where Self: 'static,

Available on crate feature exception-handling only.
source§

impl Visit for TryTable
where Self: 'static,

Available on crate feature exception-handling only.
source§

impl Visit for CallIndirect
where Self: 'static,

source§

impl Visit for MemArg
where Self: 'static,

source§

impl Visit for Data
where Self: 'static,

source§

impl Visit for Exception
where Self: 'static,

source§

impl Visit for Export
where Self: 'static,

source§

impl Visit for FuncBody
where Self: 'static,

source§

impl Visit for Global
where Self: 'static,

source§

impl Visit for Import
where Self: 'static,

source§

impl Visit for ImportPath
where Self: 'static,

source§

impl Visit for Locals
where Self: 'static,

source§

impl Visit for ProducerField
where Self: 'static,

source§

impl Visit for ProducerVersionedName
where Self: 'static,

source§

impl Visit for RawCustomSection
where Self: 'static,

source§

impl Visit for Module
where Self: 'static,

source§

impl Visit for ExceptionType
where Self: 'static,

source§

impl Visit for FuncType
where Self: 'static,

source§

impl Visit for GlobalType
where Self: 'static,

source§

impl Visit for Limits
where Self: 'static,

source§

impl Visit for MemType
where Self: 'static,

source§

impl Visit for TableType
where Self: 'static,

source§

impl<F> Visit for FloatConst<F>
where Self: 'static, F: Visit,

source§

impl<I, V> Visit for NameAssoc<I, V>
where Self: 'static, I: Visit, V: Visit,

source§

impl<I, V> Visit for NameMap<I, V>
where Self: 'static, Vec<NameAssoc<I, V>>: Visit, I: Visit, V: Visit,

source§

impl<T> Visit for Blob<T>
where Self: 'static, Lazy<T>: Visit, T: Visit + Decode,

source§

impl<T: Decode + Visit> Visit for Lazy<T>

source§

impl<const ALIGN_LOG2: u32> Visit for AlignedMemArg<ALIGN_LOG2>
where Self: 'static,

Available on crate feature threads only.
source§

impl<const MAX: u8> Visit for LaneId<MAX>
where Self: 'static,