Attempts to load the specified named item from this linker, returning `std::nullopt` if it was not defined.
| 107 | /// Attempts to load the specified named item from this linker, returning |
| 108 | /// `std::nullopt` if it was not defined. |
| 109 | [[nodiscard]] std::optional<Extern> |
| 110 | get(Store::Context cx, std::string_view module, std::string_view name) { |
| 111 | wasmtime_extern_t item; |
| 112 | if (wasmtime_linker_get(ptr.get(), cx.ptr, module.data(), module.size(), |
| 113 | name.data(), name.size(), &item)) { |
| 114 | return detail::cvt_extern(item); |
| 115 | } |
| 116 | return std::nullopt; |
| 117 | } |
| 118 | |
| 119 | /// Defines a new function in this linker in the style of the `Func` |
| 120 | /// constructor. |
no test coverage detected