pub struct TypedFunc<Params, Results> { /* private fields */ }Expand description
Implementations§
Source§impl<Params, Results> TypedFunc<Params, Results>where
Params: WasmParams,
Results: WasmResults,
impl<Params, Results> TypedFunc<Params, Results>where
Params: WasmParams,
Results: WasmResults,
Sourcepub fn call(
&self,
ctx: impl AsContextMut,
params: Params,
) -> Result<Results, Error>
pub fn call( &self, ctx: impl AsContextMut, params: Params, ) -> Result<Results, Error>
Calls this Wasm or host function with the specified parameters.
Returns either the results of the call, or a Error if one happened.
For more information, see the Func::typed and Func::call
documentation.
§Panics
Panics if ctx does not own this TypedFunc.
§Errors
If the execution of the called Wasm function traps.
Sourcepub fn call_resumable(
&self,
ctx: impl AsContextMut,
params: Params,
) -> Result<TypedResumableCall<Results>, Error>
pub fn call_resumable( &self, ctx: impl AsContextMut, params: Params, ) -> Result<TypedResumableCall<Results>, Error>
Calls this Wasm or host function with the specified parameters.
Returns a resumable handle to the function invocation upon encountering host errors with which it is possible to handle the error and continue the execution as if no error occurred.
§Note
This is a non-standard WebAssembly API and might not be available at other WebAssembly engines. Please be aware that depending on this feature might mean a lock-in to Wasmi for users.
§Errors
If the function returned a Error originating from WebAssembly.