MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / get

Method get

crates/c-api/include/wasmtime/instance.hh:85–92  ·  view source on GitHub ↗

* \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`. */

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 5

cvt_externFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected