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)
| 473 | // May return `nil` if the export doesn't exist, if it's not a memory, if there isn't |
| 474 | // a caller, etc. |
| 475 | func (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`. |
| 495 | func (c *Caller) Context() *C.wasmtime_context_t { |