Struct wasmedge_sdk::Module
source · pub struct Module { /* private fields */ }
Expand description
Defines compiled in-memory representation of an input WASM binary.
A Module is a compiled in-memory representation of an input WebAssembly binary. In the instantiation process, a Module is instatiated to a module instance, from which the exported function, table, memory, and global instances can be fetched.
Implementations§
source§impl Module
impl Module
sourcepub fn from_bytes(
config: Option<&Config>,
bytes: impl AsRef<[u8]>
) -> WasmEdgeResult<Self>
pub fn from_bytes( config: Option<&Config>, bytes: impl AsRef<[u8]> ) -> WasmEdgeResult<Self>
sourcepub fn count_of_imports(&self) -> u32
pub fn count_of_imports(&self) -> u32
Returns the count of the imported WasmEdge instances in the module.
sourcepub fn imports(&self) -> Vec<ImportType<'_>>
pub fn imports(&self) -> Vec<ImportType<'_>>
Returns the import types of all imported WasmEdge instances in the module.
sourcepub fn count_of_exports(&self) -> u32
pub fn count_of_exports(&self) -> u32
Returns the count of the exported WasmEdge instances from the module.
sourcepub fn exports(&self) -> Vec<ExportType<'_>>
pub fn exports(&self) -> Vec<ExportType<'_>>
Returns the export types of all exported WasmEdge instances (including funcs, tables, globals and memories) from the module.
sourcepub fn get_export(&self, name: impl AsRef<str>) -> Option<ExternalInstanceType>
pub fn get_export(&self, name: impl AsRef<str>) -> Option<ExternalInstanceType>
Gets the export type by the name of a specific exported WasmEdge instance, such as func, table, global or memory instance.
§Argument
name
- The name of the target exported WasmEdge instance, such as func, table, global or memory instance.