Exports returns a list of exports from this instance. Each export is returned as a `*Extern` and lines up with the exports list of the associated `Module`.
(store Storelike)
| 64 | // Each export is returned as a `*Extern` and lines up with the exports list of |
| 65 | // the associated `Module`. |
| 66 | func (instance *Instance) Exports(store Storelike) []*Extern { |
| 67 | ret := make([]*Extern, 0) |
| 68 | var name *C.char |
| 69 | var name_len C.size_t |
| 70 | for i := 0; ; i++ { |
| 71 | var item C.wasmtime_extern_t |
| 72 | ok := C.wasmtime_instance_export_nth( |
| 73 | store.Context(), |
| 74 | &instance.val, |
| 75 | C.size_t(i), |
| 76 | &name, |
| 77 | &name_len, |
| 78 | &item, |
| 79 | ) |
| 80 | if !ok { |
| 81 | break |
| 82 | } |
| 83 | ret = append(ret, mkExtern(&item)) |
| 84 | } |
| 85 | runtime.KeepAlive(store) |
| 86 | return ret |
| 87 | } |
| 88 | |
| 89 | // GetExport attempts to find an export on this instance by `name` |
| 90 | // |