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§
sourcefn new(engine: &E, stream: impl Read) -> Result<Self>
fn new(engine: &E, stream: impl Read) -> Result<Self>
Creates a new module from the given byte stream.
sourcefn exports(&self) -> Box<dyn Iterator<Item = ExportType<'_>> + '_>
fn exports(&self) -> Box<dyn Iterator<Item = ExportType<'_>> + '_>
Gets the export types of the module.
sourcefn get_export(&self, name: &str) -> Option<ExternType>
fn get_export(&self, name: &str) -> Option<ExternType>
Gets the export type of the given name, if any, from this module.
sourcefn imports(&self) -> Box<dyn Iterator<Item = ImportType<'_>> + '_>
fn imports(&self) -> Box<dyn Iterator<Item = ImportType<'_>> + '_>
Gets the import types of the module.
Object Safety§
This trait is not object safe.