Struct wasmedge_sys::Executor

source ·
pub struct Executor { /* private fields */ }
Expand description

Defines an execution environment for both pure WASM and compiled WASM.

Implementations§

Creates a new executor to be associated with the given config and statistics.

Arguments
Error

If fail to create a executor, then an error is returned.

Registers and instantiates a WasmEdge import object into a store.

Arguments
Error

If fail to register the given import object, then an error is returned.

Registers and instantiates a WasmEdge module into a store.

Instantiates the given WasmEdge module, including the functions, memories, tables, and globals it hosts; and then, registers the module instance into the store with the given name.

Arguments
  • store - The target store, into which the given module is registered.

  • module - A validated module to be registered.

  • name - The exported name of the registered module.

Error

If fail to register the given module, then an error is returned.

Registers and instantiates a WasmEdge module into a store as an anonymous module.

Notice that when a new module is instantiated into the store, the old instantiated module is removed; in addition, ensure that the imports the module depends are already registered into the store.

Arguments
  • store - The store, in which the module to be instantiated is stored.

  • ast_mod - The target module to be instantiated.

Error

If fail to instantiate the given module, then an error is returned.

Registers plugin module instance into a store.

Arguments
  • store - The store, in which the module to be instantiated is stored.

  • instance - The plugin module instance to be registered.

Error

If fail to register the given plugin module instance, then an error is returned.

Runs a host function instance and returns the results.

Arguments
  • func - The function instance to run.

  • params - The arguments to pass to the function.

Errors

If fail to run the host function, then an error is returned.

Asynchronously runs a host function instance and returns the results.

Arguments
  • func - The function instance to run.

  • params - The arguments to pass to the function.

Errors

If fail to run the host function, then an error is returned.

Runs a host function reference instance and returns the results.

Arguments
  • func_ref - The function reference instance to run.

  • params - The arguments to pass to the function.

Errors

If fail to run the host function reference instance, then an error is returned.

Asynchronously runs a host function reference instance and returns the results.

Arguments
  • func_ref - The function reference instance to run.

  • params - The arguments to pass to the function.

Errors

If fail to run the host function reference instance, then an error is returned.

Provides a raw pointer to the inner Executor context.

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
Executes the destructor for this type. Read more
Runs a host function instance and returns the results. Read more
Runs a host function instance by calling its reference and returns the results. 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.