pub fn push_import<'a>(self, cx: &mut ModuleContext<'a>, import: wasmparser::Import<'a>) {
        cx.defined_mut(self).imports.push(import);

        // Add the import to the appropriate index space for our current module.
        match import.ty {
            wasmparser::ImportSectionEntryType::Memory(ty) => {
                self.push_imported_memory(cx, ty);
            }
            wasmparser::ImportSectionEntryType::Global(ty) => {
                self.push_imported_global(cx, ty);
            }
            wasmparser::ImportSectionEntryType::Instance(ty_idx) => {
                let ty = self.instance_type_at(cx, ty_idx).clone();
                self.push_imported_instance(cx, ty);
            }
            wasmparser::ImportSectionEntryType::Function(ty_idx) => {
                let ty = self.type_id_at(cx, ty_idx);
                self.push_function(cx, ty);
            }
            wasmparser::ImportSectionEntryType::Table(ty) => {
                self.push_table(cx, ty);
            }
            wasmparser::ImportSectionEntryType::Module(_) => {
                unreachable!("we disallow module imports; checked in validation")
            }
            wasmparser::ImportSectionEntryType::Event(_) => {
                unreachable!("exceptions are unsupported; checked in validation")
            }
        }
    }
/// Push a new import into this module.
Push a new import into this module.
Push a new import into this module .
pub fn push_import<'a>(self, cx: &mut ModuleContext<'a>, import: wasmparser::Import<'a>) {
        cx.defined_mut(self).imports.push(import);
        // Add the import to the appropriate index space for our current module.
        match import.ty {
            wasmparser::ImportSectionEntryType::Memory(ty) => {
                self.push_imported_memory(cx, ty);
            }
            wasmparser::ImportSectionEntryType::Global(ty) => {
                self.push_imported_global(cx, ty);
            }
            wasmparser::ImportSectionEntryType::Instance(ty_idx) => {
                let ty = self.instance_type_at(cx, ty_idx).clone();
                self.push_imported_instance(cx, ty);
            }
            wasmparser::ImportSectionEntryType::Function(ty_idx) => {
                let ty = self.type_id_at(cx, ty_idx);
                self.push_function(cx, ty);
            }
            wasmparser::ImportSectionEntryType::Table(ty) => {
                self.push_table(cx, ty);
            }
            wasmparser::ImportSectionEntryType::Module(_) => {
                unreachable!("we disallow module imports; checked in validation")
            }
            wasmparser::ImportSectionEntryType::Event(_) => {
                unreachable!("exceptions are unsupported; checked in validation")
            }
        }
    }
pub fn push_import < ' a > ( self , cx : & mut ModuleContext < ' a > , import : wasmparser :: Import < ' a > ) { cx . defined_mut ( self ) . imports . push ( import ) ; // Add the import to the appropriate index space for our current module. match import . ty { wasmparser :: ImportSectionEntryType :: Memory ( ty ) => { self . push_imported_memory ( cx , ty ) ; } wasmparser :: ImportSectionEntryType :: Global ( ty ) => { self . push_imported_global ( cx , ty ) ; } wasmparser :: ImportSectionEntryType :: Instance ( ty_idx ) => { let ty = self . instance_type_at ( cx , ty_idx ) . clone ( ) ; self . push_imported_instance ( cx , ty ) ; } wasmparser :: ImportSectionEntryType :: Function ( ty_idx ) => { let ty = self . type_id_at ( cx , ty_idx ) ; self . push_function ( cx , ty ) ; } wasmparser :: ImportSectionEntryType :: Table ( ty ) => { self . push_table ( cx , ty ) ; } wasmparser :: ImportSectionEntryType :: Module ( _ ) => { unreachable ! ( " " ) } wasmparser :: ImportSectionEntryType :: Event ( _ ) => { unreachable ! ( " " ) } } }
Push a new import into this module.
Push a new import into this module .
self
cx
&mut ModuleContext<'a>
import
wasmparser::Import<'a>
self
cx
&mut ModuleContext<'a>
import
wasmparser::Import<'a>