Returns the list of imports that this [`Module`] has and must be satisfied. This function returns the list of imports that the wasm module has, but only the types of each import. The type of each import is used to typecheck the [`Instance::new`](crate::Instance::new) method's `imports` argument. The arguments to that function must match up 1-to-1 with the entries in the array returned here. The
(
&'module self,
)
| 751 | /// # } |
| 752 | /// ``` |
| 753 | pub fn imports<'module>( |
| 754 | &'module self, |
| 755 | ) -> impl ExactSizeIterator<Item = ImportType<'module>> + 'module { |
| 756 | let module = self.compiled_module().module(); |
| 757 | let types = self.types(); |
| 758 | let engine = self.engine(); |
| 759 | module.imports().map(move |(imp_mod, imp_field, ty)| { |
| 760 | debug_assert!(ty.is_canonicalized_for_runtime_usage()); |
| 761 | ImportType::new(imp_mod, imp_field, ty, types, engine) |
| 762 | }) |
| 763 | } |
| 764 | |
| 765 | /// Returns the list of exports that this [`Module`] has and will be |
| 766 | /// available after instantiation. |