Skip to main content

WasmModule

Trait WasmModule 

Source
pub trait WasmModule: Sync + Send {
    // Required method
    fn new_instance(
        &self,
        heap_alloc_strategy: HeapAllocStrategy,
    ) -> Result<Box<dyn WasmInstance>, Error>;
}
Expand description

A trait that defines an abstract WASM runtime module.

This can be implemented by an execution engine.

Required Methods§

Source

fn new_instance( &self, heap_alloc_strategy: HeapAllocStrategy, ) -> Result<Box<dyn WasmInstance>, Error>

Create a new instance with the given heap allocation strategy.

The heap_alloc_strategy determines the memory limits applied to this instance.

Implementors§