Trait wasmedge_sdk::Engine

source ·
pub trait Engine {
    // Required methods
    fn run_func(
        &self,
        func: &Func,
        params: impl IntoIterator<Item = WasmValue>
    ) -> WasmEdgeResult<Vec<WasmValue>>;
    fn run_func_ref(
        &self,
        func_ref: &FuncRef,
        params: impl IntoIterator<Item = WasmValue>
    ) -> WasmEdgeResult<Vec<WasmValue>>;
}
Expand description

The object that is used to perform a host function is required to implement this trait.

Required Methods§

source

fn run_func( &self, func: &Func, params: impl IntoIterator<Item = WasmValue> ) -> WasmEdgeResult<Vec<WasmValue>>

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.

source

fn run_func_ref( &self, func_ref: &FuncRef, params: impl IntoIterator<Item = WasmValue> ) -> WasmEdgeResult<Vec<WasmValue>>

Runs a host function instance by calling its reference and returns the results.

Arguments
  • func_ref - A reference to the target host function instance.

  • params - The arguments to pass to the function.

Errors

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

Object Safety§

This trait is not object safe.

Implementors§