Trait wasmtime_environ::TypeTrace

source ·
pub trait TypeTrace {
    // Required methods
    fn trace<F, E>(&self, func: &mut F) -> Result<(), E>
       where F: FnMut(EngineOrModuleTypeIndex) -> Result<(), E>;
    fn trace_mut<F, E>(&mut self, func: &mut F) -> Result<(), E>
       where F: FnMut(&mut EngineOrModuleTypeIndex) -> Result<(), E>;

    // Provided method
    fn canonicalize<F>(&mut self, module_to_engine: &mut F)
       where F: FnMut(ModuleInternedTypeIndex) -> u32 { ... }
}
Expand description

A trait for things that can trace all type-to-type edges, aka all type indices within this thing.

Required Methods§

source

fn trace<F, E>(&self, func: &mut F) -> Result<(), E>

Visit each edge.

The function can break out of tracing by returning Err(E).

source

fn trace_mut<F, E>(&mut self, func: &mut F) -> Result<(), E>
where F: FnMut(&mut EngineOrModuleTypeIndex) -> Result<(), E>,

Visit each edge, mutably.

Allows updating edges.

The function can break out of tracing by returning Err(E).

Provided Methods§

source

fn canonicalize<F>(&mut self, module_to_engine: &mut F)

Canonicalize self by rewriting all type references inside self from module-level interned type indices to engine-level interned type indices.

Object Safety§

This trait is not object safe.

Implementors§