GetDefault acquires the "default export" of the named module in this linker. If there is no default item then an error is returned, otherwise the default function is returned. For more information see the Rust documentation -- https://docs.wasmtime.dev/api/wasmtime/struct.Linker.html#method.get_de
(store Storelike, name string)
| 261 | // For more information see the Rust documentation -- |
| 262 | // https://docs.wasmtime.dev/api/wasmtime/struct.Linker.html#method.get_default. |
| 263 | func (l *Linker) GetDefault(store Storelike, name string) (*Func, error) { |
| 264 | var ret C.wasmtime_func_t |
| 265 | err := C.wasmtime_linker_get_default( |
| 266 | l.ptr(), |
| 267 | store.Context(), |
| 268 | C._GoStringPtr(name), |
| 269 | C._GoStringLen(name), |
| 270 | &ret, |
| 271 | ) |
| 272 | runtime.KeepAlive(l) |
| 273 | runtime.KeepAlive(name) |
| 274 | runtime.KeepAlive(store) |
| 275 | if err != nil { |
| 276 | return nil, mkError(err) |
| 277 | } |
| 278 | return mkFunc(ret), nil |
| 279 | |
| 280 | } |
| 281 | |
| 282 | // GetOneByName loads an item by name from this linker. |
| 283 | // |