wasmedge_sys::ffi

Function WasmEdge_VMRegisterModuleFromBytes

Source
pub unsafe extern "C" fn WasmEdge_VMRegisterModuleFromBytes(
    Cxt: *mut WasmEdge_VMContext,
    ModuleName: WasmEdge_String,
    Bytes: WasmEdge_Bytes,
) -> WasmEdge_Result
Expand description

Register and instantiate WASM into the store in VM from a WasmEdge_Bytes.

Load a WASM module from a WasmEdge_Bytes, and register all exported instances and instantiate them into the store into the VM with their exported name and module name.

This function is thread-safe.

\param Cxt the WasmEdge_VMContext which contains the store. \param ModuleName the WasmEdge_String of module name for all exported instances. \param Bytes the WasmEdge_Bytes of WASM binary.

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error message.