Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§