fn resolve_imports(
        &mut self,
        store: &mut StoreOpaque,
    ) -> Result<(Instance, Option<FuncIndex>)> {
        store.bump_resource_counts(&self.module)?;

        // Read the current module's initializer and move forward the
        // initializer pointer as well.
        let num_imports = self.module.env_module().initializers.len();
        match &self.imports {
            ImportSource::Externs(list) => {
                assert_eq!(list.len(), num_imports);
                for item in list.iter() {
                    self.push(item.clone(), store);
                }
            }
            ImportSource::Definitions(list) => {
                assert_eq!(list.len(), num_imports);
                for item in list.iter() {
                    // This unsafety is encapsulated with
                    // `Instantiator::new`, documented above.
                    self.push(unsafe { item.to_extern(store) }, store);
                }
            }
        }

        // All initializers have been processed, which means we're ready to
        // perform the actual raw instantiation with the raw import values. This
        // will register everything except the start function's completion and
        // the finished instance will be returned.
        self.instantiate_raw(store)
    }
/// Resolve all the imports for the module being instantiated, extracting
/// the raw representations and building up the `PrimaryMap` instance for
/// each set of exports.
Resolve all the imports for the module being instantiated, extracting
the raw representations and building up the `PrimaryMap` instance for
each set of exports.
Resolve all the imports for the module being instantiated extracting the raw representations and building up the ` PrimaryMap ` instance for each set of exports .
fn resolve_imports(
        &mut self,
        store: &mut StoreOpaque,
    ) -> Result<(Instance, Option<FuncIndex>)> {
        store.bump_resource_counts(&self.module)?;
        // Read the current module's initializer and move forward the
        // initializer pointer as well.
        let num_imports = self.module.env_module().initializers.len();
        match &self.imports {
            ImportSource::Externs(list) => {
                assert_eq!(list.len(), num_imports);
                for item in list.iter() {
                    self.push(item.clone(), store);
                }
            }
            ImportSource::Definitions(list) => {
                assert_eq!(list.len(), num_imports);
                for item in list.iter() {
                    // This unsafety is encapsulated with
                    // `Instantiator::new`, documented above.
                    self.push(unsafe { item.to_extern(store) }, store);
                }
            }
        }
        // All initializers have been processed, which means we're ready to
        // perform the actual raw instantiation with the raw import values. This
        // will register everything except the start function's completion and
        // the finished instance will be returned.
        self.instantiate_raw(store)
    }
fn resolve_imports ( & mut self , store : & mut StoreOpaque , ) -> Result < ( Instance , Option < FuncIndex > ) > { store . bump_resource_counts ( & self . module ) ? ; // Read the current module's initializer and move forward the // initializer pointer as well. let num_imports = self . module . env_module ( ) . initializers . len ( ) ; match & self . imports { ImportSource :: Externs ( list ) => { assert_eq ! ( list len ( ) num_imports ) ; for item in list . iter ( ) { self . push ( item . clone ( ) , store ) ; } } ImportSource :: Definitions ( list ) => { assert_eq ! ( list len ( ) num_imports ) ; for item in list . iter ( ) { // This unsafety is encapsulated with // `Instantiator::new`, documented above. self . push ( unsafe { item . to_extern ( store ) } , store ) ; } } } // All initializers have been processed, which means we're ready to // perform the actual raw instantiation with the raw import values. This // will register everything except the start function's completion and // the finished instance will be returned. self . instantiate_raw ( store ) }
Resolve all the imports for the module being instantiated, extracting
the raw representations and building up the `PrimaryMap` instance for
each set of exports.
Resolve all the imports for the module being instantiated extracting the raw representations and building up the ` PrimaryMap ` instance for each set of exports .
&mut self
store
&mut StoreOpaque
&mut self
store
&mut StoreOpaque