logo
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 specifies a global configuration.

  • file specifies the path to the target 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 specifies a global configuration.

  • bytes specifies 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 specifies the name of the target exported WasmEdge instance.

Trait Implementations

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