MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime-go / GetExport

Method GetExport

instance.go:92–107  ·  view source on GitHub ↗

GetExport attempts to find an export on this instance by `name` May return `nil` if this instance has no export named `name`

(store Storelike, name string)

Source from the content-addressed store, hash-verified

90//
91// May return `nil` if this instance has no export named `name`
92func (i *Instance) GetExport(store Storelike, name string) *Extern {
93 var item C.wasmtime_extern_t
94 ok := C.wasmtime_instance_export_get(
95 store.Context(),
96 &i.val,
97 C._GoStringPtr(name),
98 C._GoStringLen(name),
99 &item,
100 )
101 runtime.KeepAlive(store)
102 runtime.KeepAlive(name)
103 if ok {
104 return mkExtern(&item)
105 }
106 return nil
107}
108
109// GetFunc attempts to find a function on this instance by `name`.
110//

Callers 3

ExampleMemoryFunction · 0.95
ExampleVal_ExternrefFunction · 0.95
GetFuncMethod · 0.95

Calls 2

mkExternFunction · 0.85
ContextMethod · 0.65

Tested by 2

ExampleMemoryFunction · 0.76
ExampleVal_ExternrefFunction · 0.76