MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / WasmEdge_FunctionInstanceCreateBinding

Function WasmEdge_FunctionInstanceCreateBinding

lib/api/wasmedge.cpp:2691–2706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2689}
2690
2691WASMEDGE_CAPI_EXPORT WasmEdge_FunctionInstanceContext *
2692WasmEdge_FunctionInstanceCreateBinding(const WasmEdge_FunctionTypeContext *Type,
2693 WasmEdge_WrapFunc_t WrapFunc,
2694 void *Binding, void *Data,
2695 const uint64_t Cost) noexcept {
2696 try {
2697 if (Type && WrapFunc) {
2698 return toFuncCxt(new WasmEdge::Runtime::Instance::FunctionInstance(
2699 std::make_unique<CAPIHostFunc>(fromFuncTypeCxt(Type), WrapFunc,
2700 Binding, Data, Cost)));
2701 }
2702 } catch (...) {
2703 handleCAPIError();
2704 }
2705 return nullptr;
2706}
2707
2708WASMEDGE_CAPI_EXPORT const WasmEdge_FunctionTypeContext *
2709WasmEdge_FunctionInstanceGetFunctionType(

Callers 2

TESTFunction · 0.85

Calls 1

handleCAPIErrorFunction · 0.85

Tested by 2

TESTFunction · 0.68