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

Method get_export

crates/wasmtime/src/runtime/func.rs:2039–2045  ·  view source on GitHub ↗

Looks up an export from the caller's module by the `name` given. This is a low-level function that's typically used to implement passing of pointers or indices between core Wasm instances, where the callee needs to consult the caller's exports to perform memory management and resolve the references. For comparison, in components, the component model handles translating arguments from one compone

(&mut self, name: &str)

Source from the content-addressed store, hash-verified

2037 /// It's recommended to take care when calling this API and gracefully
2038 /// handling a `None` return value.
2039 pub fn get_export(&mut self, name: &str) -> Option<Extern> {
2040 // All instances created have a `host_state` with a pointer pointing
2041 // back to themselves. If this caller doesn't have that `host_state`
2042 // then it probably means it was a host-created object like `Func::new`
2043 // which doesn't have any exports we want to return anyway.
2044 self.caller.get_export(&mut self.store, name)
2045 }
2046
2047 /// Looks up an exported [`Extern`] value by a [`ModuleExport`] value.
2048 ///

Callers 15

test_trap_through_hostFunction · 0.45
rust_catch_panic_importFunction · 0.45
call_linked_funcFunction · 0.45
call_linked_func_asyncFunction · 0.45
recursionFunction · 0.45
trappingFunction · 0.45
basic_async_hookFunction · 0.45
function_interpositionFunction · 0.45
module_interpositionFunction · 0.45

Calls

no outgoing calls

Tested by 13

test_trap_through_hostFunction · 0.36
rust_catch_panic_importFunction · 0.36
call_linked_funcFunction · 0.36
recursionFunction · 0.36
trappingFunction · 0.36
export_old_get_newFunction · 0.36
export_new_get_oldFunction · 0.36
make_externsFunction · 0.36
instance_get_exportFunction · 0.36
caller_get_exportFunction · 0.36