Defines all exports of the `instance` provided in this linker with the given module name of `name`.
| 67 | /// Defines all exports of the `instance` provided in this linker with the |
| 68 | /// given module name of `name`. |
| 69 | Result<std::monostate> |
| 70 | define_instance(Store::Context cx, std::string_view name, Instance instance) { |
| 71 | auto *error = wasmtime_linker_define_instance( |
| 72 | ptr.get(), cx.ptr, name.data(), name.size(), &instance.instance); |
| 73 | if (error != nullptr) { |
| 74 | return Error(error); |
| 75 | } |
| 76 | return std::monostate(); |
| 77 | } |
| 78 | |
| 79 | /// Instantiates the module `m` provided within the store `cx` using the items |
| 80 | /// defined within this linker. |