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

Method get_by_name

cranelift/interpreter/src/environment.rs:46–49  ·  view source on GitHub ↗

Retrieve a function by its name.

(&self, name: &str)

Source from the content-addressed store, hash-verified

44
45 /// Retrieve a function by its name.
46 pub fn get_by_name(&self, name: &str) -> Option<&'a Function> {
47 let index = self.index_of(name)?;
48 self.get_by_index(index)
49 }
50
51 /// Retrieve a function from a [FuncRef] within a [Function]. TODO this should be optimized, if possible, as
52 /// currently it retrieves the function name as a string and performs string matching.

Callers 1

get_from_func_refMethod · 0.80

Calls 2

index_ofMethod · 0.80
get_by_indexMethod · 0.80

Tested by

no test coverage detected