Get information about functions in this module's `.text` section: their index, name, and offset+length. Results are yielded in a ModuleFunction struct.
(&'a self)
| 1089 | /// |
| 1090 | /// Results are yielded in a ModuleFunction struct. |
| 1091 | pub fn functions<'a>(&'a self) -> impl ExactSizeIterator<Item = ModuleFunction> + 'a { |
| 1092 | let module = self.compiled_module(); |
| 1093 | let module_index = self.env_module().module_index; |
| 1094 | self.env_module().defined_func_indices().map(move |idx| { |
| 1095 | let key = FuncKey::DefinedWasmFunction(module_index, idx); |
| 1096 | let loc = module.func_loc(key); |
| 1097 | let idx = module.module().func_index(idx); |
| 1098 | ModuleFunction { |
| 1099 | module: module_index, |
| 1100 | index: idx, |
| 1101 | name: module.func_name(idx).map(|n| n.to_string()), |
| 1102 | offset: loc.start as usize, |
| 1103 | len: loc.length as usize, |
| 1104 | } |
| 1105 | }) |
| 1106 | } |
| 1107 | |
| 1108 | pub(crate) fn id(&self) -> CompiledModuleId { |
| 1109 | self.inner.module.unique_id() |
no test coverage detected