pub unsafe extern "C" fn WasmEdge_VMRegisterModuleFromImport(
    Cxt: *mut WasmEdge_VMContext,
    ImportCxt: *const WasmEdge_ModuleInstanceContext
) -> WasmEdge_Result
Expand description

Register a module instance into the store in VM with exporting its module name.

Register an existing module into the store in VM with its module name. After calling this function, the module instance is registered into the store in VM, and the other modules can import the instances for linking when instantiating other modules. Developers should guarantee the life cycle of this registered module instance, or the error will occur when in execution after the module instance destroyed if it has been imported by other modules.

This function is thread-safe.

\param Cxt the WasmEdge_VMContext which contains the store. \param ImportCxt the WasmEdge_ModuleInstanceContext to register.

\returns WasmEdge_Result. Call WasmEdge_ResultGetMessage for the error message.