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

Method exported_functions

crates/fuzzing/src/oracles/diff_wasmtime.rs:96–107  ·  view source on GitHub ↗

Retrieve the names and types of all exported functions in the instance. This is useful for evaluating each exported function with different values. The [`DiffInstance`] trait asks for the function name and we need to know the function signature in order to pass in the right arguments.

(&mut self)

Source from the content-addressed store, hash-verified

94 /// need to know the function signature in order to pass in the right
95 /// arguments.
96 pub fn exported_functions(&mut self) -> Vec<(String, FuncType)> {
97 let exported_functions = self
98 .instance
99 .exports(&mut self.store)
100 .map(|e| (e.name().to_owned(), e.into_func()))
101 .filter_map(|(n, f)| f.map(|f| (n, f)))
102 .collect::<Vec<_>>();
103 exported_functions
104 .into_iter()
105 .map(|(n, f)| (n, f.ty(&self.store)))
106 .collect()
107 }
108
109 /// Returns the list of globals and their types exported from this instance.
110 pub fn exported_globals(&mut self) -> Vec<(String, DiffValueType)> {

Callers 1

execute_oneFunction · 0.80

Calls 7

collectMethod · 0.80
mapMethod · 0.45
exportsMethod · 0.45
nameMethod · 0.45
into_funcMethod · 0.45
into_iterMethod · 0.45
tyMethod · 0.45

Tested by

no test coverage detected