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