Function wasmedge_sys::ffi::WasmEdge_VMRunWasmFromASTModule
source · pub unsafe extern "C" fn WasmEdge_VMRunWasmFromASTModule(
Cxt: *mut WasmEdge_VMContext,
ASTCxt: *const WasmEdge_ASTModuleContext,
FuncName: WasmEdge_String,
Params: *const WasmEdge_Value,
ParamLen: u32,
Returns: *mut WasmEdge_Value,
ReturnLen: u32
) -> WasmEdge_Result
Expand description
Instantiate the WASM module from a WasmEdge AST Module and invoke a function by name.
This is the function to invoke a WASM function rapidly.
Load and instantiate the WASM module from the WasmEdge AST Module, and then
invoke the function by name and parameters. If the Returns
buffer length
is smaller than the arity of the function, the overflowed return values will
be discarded.
After calling this function, a new module instance is instantiated, and the
old one will be destroyed.
This function is thread-safe.
\param Cxt the WasmEdge_VMContext. \param ASTCxt the WasmEdge AST Module context generated by loader or compiler. \param FuncName the function name WasmEdge_String. \param Params the WasmEdge_Value buffer with the parameter values. \param ParamLen the parameter buffer length. \param [out] Returns the WasmEdge_Value buffer to fill the return values. \param ReturnLen the return buffer length.
\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage
for the error
message.