Defines the provided item into this linker with the given name.
| 38 | |
| 39 | /// Defines the provided item into this linker with the given name. |
| 40 | Result<std::monostate> define(Store::Context cx, std::string_view module, |
| 41 | std::string_view name, const Extern &item) { |
| 42 | wasmtime_extern_t raw; |
| 43 | detail::cvt_extern(item, raw); |
| 44 | auto *error = |
| 45 | wasmtime_linker_define(ptr.get(), cx.ptr, module.data(), module.size(), |
| 46 | name.data(), name.size(), &raw); |
| 47 | if (error != nullptr) { |
| 48 | return Error(error); |
| 49 | } |
| 50 | return std::monostate(); |
| 51 | } |
| 52 | |
| 53 | #ifdef WASMTIME_FEATURE_WASI |
| 54 | /// Defines WASI functions within this linker. |