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

Method GetFunc

instance.go:113–119  ·  view source on GitHub ↗

GetFunc attempts to find a function on this instance by `name`. May return `nil` if this instance has no function named `name`, it is not a function, etc.

(store Storelike, name string)

Source from the content-addressed store, hash-verified

111// May return `nil` if this instance has no function named `name`,
112// it is not a function, etc.
113func (i *Instance) GetFunc(store Storelike, name string) *Func {
114 f := i.GetExport(store, name)
115 if f == nil {
116 return nil
117 }
118 return f.Func()
119}

Callers 15

TestInstanceGetFuncFunction · 0.95
TestStoreDataFunction · 0.95
TestCallFuncFromCallerFunction · 0.95
TestPanicTrapsFunction · 0.95
ExampleConfig_fuelFunction · 0.95
ExampleConfig_interruptFunction · 0.95
ExampleConfig_multiFunction · 0.95
ExampleMemoryFunction · 0.95
ExampleModule_serializeFunction · 0.95
ExampleVal_ExternrefFunction · 0.95
Example_helloFunction · 0.95
Example_gcdFunction · 0.95

Calls 2

GetExportMethod · 0.95
FuncMethod · 0.80

Tested by 15

TestInstanceGetFuncFunction · 0.76
TestStoreDataFunction · 0.76
TestCallFuncFromCallerFunction · 0.76
TestPanicTrapsFunction · 0.76
ExampleConfig_fuelFunction · 0.76
ExampleConfig_interruptFunction · 0.76
ExampleConfig_multiFunction · 0.76
ExampleMemoryFunction · 0.76
ExampleModule_serializeFunction · 0.76
ExampleVal_ExternrefFunction · 0.76
Example_helloFunction · 0.76
Example_gcdFunction · 0.76