Trait wasm_runtime_layer::backend::WasmModule

source ·
pub trait WasmModule<E: WasmEngine>: Clone + Sized + Send + Sync {
    // Required methods
    fn new(engine: &E, stream: impl Read) -> Result<Self>;
    fn exports(&self) -> Box<dyn Iterator<Item = ExportType<'_>> + '_>;
    fn get_export(&self, name: &str) -> Option<ExternType>;
    fn imports(&self) -> Box<dyn Iterator<Item = ImportType<'_>> + '_>;
}
Expand description

Provides a parsed and validated WASM module.

Required Methods§

source

fn new(engine: &E, stream: impl Read) -> Result<Self>

Creates a new module from the given byte stream.

source

fn exports(&self) -> Box<dyn Iterator<Item = ExportType<'_>> + '_>

Gets the export types of the module.

source

fn get_export(&self, name: &str) -> Option<ExternType>

Gets the export type of the given name, if any, from this module.

source

fn imports(&self) -> Box<dyn Iterator<Item = ImportType<'_>> + '_>

Gets the import types of the module.

Object Safety§

This trait is not object safe.

Implementors§