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§

Returns a validated module from a file.

Arguments
  • config - The global configuration.

  • file - A wasm file or an AOT wasm file.

Error

If fail to load and valiate a module from a file, returns an error.

Loads a WebAssembly binary module from in-memory bytes.

Arguments
  • config - The global configuration.

  • bytes - The in-memory bytes to be parsed.

Error

If fail to load and valiate the WebAssembly module from the given in-memory bytes, returns an error.

Returns the count of the imported WasmEdge instances in the module.

Returns the import types of all imported WasmEdge instances in the module.

Returns the count of the exported WasmEdge instances from the module.

Returns the export types of all exported WasmEdge instances from the module.

Gets the export type by the name of a specific exported WasmEdge instance.

Argument
  • name - The name of the target exported WasmEdge instance.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.