Trait wasm_runtime_layer::backend::WasmFunc
source · pub trait WasmFunc<E: WasmEngine>: Clone + Sized + Send + Sync {
// Required methods
fn new<T>(
ctx: impl AsContextMut<E, UserState = T>,
ty: FuncType,
func: impl 'static + Send + Sync + Fn(E::StoreContextMut<'_, T>, &[Value<E>], &mut [Value<E>]) -> Result<()>
) -> Self;
fn ty(&self, ctx: impl AsContext<E>) -> FuncType;
fn call<T>(
&self,
ctx: impl AsContextMut<E>,
args: &[Value<E>],
results: &mut [Value<E>]
) -> Result<()>;
}
Expand description
Provides a Wasm or host function reference.
Required Methods§
Object Safety§
This trait is not object safe.