/// Create a set of dummy functions/globals/etc for the given imports.
Create a set of dummy functions/globals/etc for the given imports.
Create a set of dummy functions / globals / etc for the given imports .
pub fn dummy_imports<'module>(
    store: &Store,
    import_tys: impl Iterator<Item = ImportType<'module>>,
) -> Result<Vec<Extern>, Trap> {
    import_tys
        .map(|imp| {
            Ok(match imp.ty() {
                ExternType::Func(func_ty) => Extern::Func(dummy_func(&store, func_ty)),
                ExternType::Global(global_ty) => Extern::Global(dummy_global(&store, global_ty)?),
                ExternType::Table(table_ty) => Extern::Table(dummy_table(&store, table_ty)?),
                ExternType::Memory(mem_ty) => Extern::Memory(dummy_memory(&store, mem_ty)),
            })
        })
        .collect()
}
pub fn dummy_imports < ' module > ( store : & Store , import_tys : impl Iterator < Item = ImportType < ' module > > , ) -> Result < Vec < Extern > , Trap > { import_tys . map ( | imp | { Ok ( match imp . ty ( ) { ExternType :: Func ( func_ty ) => Extern :: Func ( dummy_func ( & store , func_ty ) ) , ExternType :: Global ( global_ty ) => Extern :: Global ( dummy_global ( & store , global_ty ) ? ) , ExternType :: Table ( table_ty ) => Extern :: Table ( dummy_table ( & store , table_ty ) ? ) , ExternType :: Memory ( mem_ty ) => Extern :: Memory ( dummy_memory ( & store , mem_ty ) ) , } ) } ) . collect ( ) }
Create a set of dummy functions/globals/etc for the given imports.
Create a set of dummy functions / globals / etc for the given imports .
store
&Store
import_tys
impl Iterator<Item = ImportType<'module>>