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

Method DefineFunc

linker.go:85–87  ·  view source on GitHub ↗

DefineFunc acts as a convenience wrapper to calling Define and WrapFunc. Returns an error if shadowing is disabled and the name is already defined.

(store Storelike, module, name string, f interface{})

Source from the content-addressed store, hash-verified

83//
84// Returns an error if shadowing is disabled and the name is already defined.
85func (l *Linker) DefineFunc(store Storelike, module, name string, f interface{}) error {
86 return l.Define(store, module, name, WrapFunc(store, f))
87}
88
89// FuncNew defines a function in this linker in the same style as `NewFunc`
90//

Callers 2

TestLinkerFunction · 0.95
TestLinkerGetOneByNameFunction · 0.95

Calls 2

DefineMethod · 0.95
WrapFuncFunction · 0.85

Tested by 2

TestLinkerFunction · 0.76
TestLinkerGetOneByNameFunction · 0.76