* \brief Load an instance's export by name. * * This function will look for an export named `name` on this instance and, if * found, return it as an `Extern`. */
| 83 | * found, return it as an `Extern`. |
| 84 | */ |
| 85 | std::optional<Extern> get(Store::Context cx, std::string_view name) { |
| 86 | wasmtime_extern_t e; |
| 87 | if (!wasmtime_instance_export_get(cx.ptr, &instance, name.data(), |
| 88 | name.size(), &e)) { |
| 89 | return std::nullopt; |
| 90 | } |
| 91 | return detail::cvt_extern(e); |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * \brief Load an instance's export by index. |
nothing calls this directly
no test coverage detected