DefineUnknownImportsAsDefaultValues defines all otherwise-missing imports of the module as values that return the default for their type. Returns an error if the imports could not be defined.
(store Storelike, module *Module)
| 220 | // |
| 221 | // Returns an error if the imports could not be defined. |
| 222 | func (l *Linker) DefineUnknownImportsAsDefaultValues(store Storelike, module *Module) error { |
| 223 | err := C.wasmtime_linker_define_unknown_imports_as_default_values( |
| 224 | l.ptr(), |
| 225 | store.Context(), |
| 226 | module.ptr(), |
| 227 | ) |
| 228 | runtime.KeepAlive(l) |
| 229 | runtime.KeepAlive(store) |
| 230 | runtime.KeepAlive(module) |
| 231 | if err == nil { |
| 232 | return nil |
| 233 | } |
| 234 | |
| 235 | return mkError(err) |
| 236 | } |
| 237 | |
| 238 | // Instantiate instantiates a module with all imports defined in this linker. |
| 239 | // |