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

Method GetExport

func.go:475–492  ·  view source on GitHub ↗

GetExport gets an exported item from the caller's module. May return `nil` if the export doesn't exist, if it's not a memory, if there isn't a caller, etc.

(name string)

Source from the content-addressed store, hash-verified

473// May return `nil` if the export doesn't exist, if it's not a memory, if there isn't
474// a caller, etc.
475func (c *Caller) GetExport(name string) *Extern {
476 if c.ptr == nil {
477 return nil
478 }
479 var ret C.wasmtime_extern_t
480 ok := C.wasmtime_caller_export_get(
481 c.ptr,
482 C._GoStringPtr(name),
483 C._GoStringLen(name),
484 &ret,
485 )
486 runtime.KeepAlive(name)
487 runtime.KeepAlive(c)
488 if ok {
489 return mkExtern(&ret)
490 }
491 return nil
492}
493
494// Implementation of the `Storelike` interface for `Caller`.
495func (c *Caller) Context() *C.wasmtime_context_t {

Callers 1

TestCallFuncFromCallerFunction · 0.45

Calls 1

mkExternFunction · 0.85

Tested by 1

TestCallFuncFromCallerFunction · 0.36