GetOneByName loads an item by name from this linker. If the item isn't defined then nil is returned, otherwise the item is returned.
(store Storelike, module, name string)
| 284 | // If the item isn't defined then nil is returned, otherwise the item is |
| 285 | // returned. |
| 286 | func (l *Linker) Get(store Storelike, module, name string) *Extern { |
| 287 | var ret C.wasmtime_extern_t |
| 288 | ok := C.wasmtime_linker_get( |
| 289 | l.ptr(), |
| 290 | store.Context(), |
| 291 | C._GoStringPtr(module), |
| 292 | C._GoStringLen(module), |
| 293 | C._GoStringPtr(name), |
| 294 | C._GoStringLen(name), |
| 295 | &ret, |
| 296 | ) |
| 297 | runtime.KeepAlive(l) |
| 298 | runtime.KeepAlive(name) |
| 299 | runtime.KeepAlive(module) |
| 300 | runtime.KeepAlive(store) |
| 301 | if ok { |
| 302 | return mkExtern(&ret) |
| 303 | } |
| 304 | return nil |
| 305 | |
| 306 | } |