Struct wasm3::Module[][src]

pub struct Module<'rt> { /* fields omitted */ }
Expand description

A loaded module belonging to a specific runtime. Allows for linking and looking up functions.

Implementations

Parses a wasm module from raw bytes.

Links the given function to the corresponding module and function name. This allows linking a more verbose function, as it gets access to the unsafe runtime parts. For easier use the make_func_wrapper should be used to create the unsafe facade for your function that then can be passed to this.

For a simple API see link_closure which takes a closure instead.

Errors

This function will return an error in the following situations:

  • a memory allocation failed
  • no function by the given name in the given module could be found
  • the function has been found but the signature did not match

Links the given closure to the corresponding module and function name. This boxes the closure and therefor requires a heap allocation.

Errors

This function will return an error in the following situations:

  • a memory allocation failed
  • no function by the given name in the given module could be found
  • the function has been found but the signature did not match

Looks up a function by the given name in this module.

Errors

This function will return an error in the following situations:

  • a memory allocation failed
  • no function by the given name in the given module could be found
  • the function has been found but the signature did not match

Looks up a function by its index in this module.

Errors

This function will return an error in the following situations:

  • a memory allocation failed
  • the index is out of bounds
  • the function has been found but the signature did not match

The name of this module.

Links wasi to this module.

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

Performs the conversion.

Performs the conversion.

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.