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)
| 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)> { |