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

Method get_func

crates/wasmtime/src/runtime/instance.rs:494–496  ·  view source on GitHub ↗

Looks up an exported [`Func`] value by name. Returns `None` if there was no export named `name`, or if there was but it wasn't a function. # Panics Panics if `store` does not own this instance.

(&self, store: impl AsContextMut, name: &str)

Source from the content-addressed store, hash-verified

492 ///
493 /// Panics if `store` does not own this instance.
494 pub fn get_func(&self, store: impl AsContextMut, name: &str) -> Option<Func> {
495 self.get_export(store, name)?.into_func()
496 }
497
498 /// Looks up an exported [`Func`] value by name and with its type.
499 ///

Calls 2

into_funcMethod · 0.45
get_exportMethod · 0.45