unsafe fn new(
        store: &StoreOpaque,
        module: &'a Module,
        imports: ImportSource<'a>,
    ) -> Result<Instantiator<'a>> {
        if !Engine::same(store.engine(), module.engine()) {
            bail!("cross-`Engine` instantiation is not currently supported");
        }

        let raw = module.compiled_module().module();
        Ok(Instantiator {
            imports,
            functions: PrimaryMap::with_capacity(raw.num_imported_funcs),
            tables: PrimaryMap::with_capacity(raw.num_imported_tables),
            memories: PrimaryMap::with_capacity(raw.num_imported_memories),
            globals: PrimaryMap::with_capacity(raw.num_imported_globals),
            module,
        })
    }
/// Creates a new instantiation context used to process all the initializer
/// directives of a module.
///
/// This doesn't do much work itself beyond setting things up.
///
/// # Unsafety
///
/// This function is unsafe for a few reasons:
///
/// * This assumes that `imports` has already been typechecked and is of the
///   appropriate length. It is memory unsafe if the types of `imports` are
///   not what `module` expects.
///
/// * The `imports` must be safely able to get inserted into `store`. This
///   only applies if `ImportSource::Definitions` is used because this will
///   internally call `Definition::to_extern` which requires that any
///   host functions in the list were created with an original `T` as the
///   store that's being inserted into.
///
/// * The `imports` must all come from the `store` specified.
Creates a new instantiation context used to process all the initializer
directives of a module.

This doesn't do much work itself beyond setting things up.
Creates a new instantiation context used to process all the initializer directives of a module . This doesn ' t do much work itself beyond setting things up .
unsafe fn new(
        store: &StoreOpaque,
        module: &'a Module,
        imports: ImportSource<'a>,
    ) -> Result<Instantiator<'a>> {
        if !Engine::same(store.engine(), module.engine()) {
            bail!("cross-`Engine` instantiation is not currently supported");
        }
        let raw = module.compiled_module().module();
        Ok(Instantiator {
            imports,
            functions: PrimaryMap::with_capacity(raw.num_imported_funcs),
            tables: PrimaryMap::with_capacity(raw.num_imported_tables),
            memories: PrimaryMap::with_capacity(raw.num_imported_memories),
            globals: PrimaryMap::with_capacity(raw.num_imported_globals),
            module,
        })
    }
unsafe fn new ( store : & StoreOpaque , module : & ' a Module , imports : ImportSource < ' a > , ) -> Result < Instantiator < ' a > > { if ! Engine :: same ( store . engine ( ) , module . engine ( ) ) { bail ! ( " " ) ; } let raw = module . compiled_module ( ) . module ( ) ; Ok ( Instantiator { imports , functions : PrimaryMap :: with_capacity ( raw . num_imported_funcs ) , tables : PrimaryMap :: with_capacity ( raw . num_imported_tables ) , memories : PrimaryMap :: with_capacity ( raw . num_imported_memories ) , globals : PrimaryMap :: with_capacity ( raw . num_imported_globals ) , module , } ) }
Creates a new instantiation context used to process all the initializer
directives of a module.
Creates a new instantiation context used to process all the initializer directives of a module .
store
&StoreOpaque
module
&'a Module
imports
ImportSource<'a>
store
&StoreOpaque
module
&'a Module
imports
ImportSource<'a>
unsafety
This function is unsafe for a few reasons.

This assumes that `imports` has already been typechecked and is of the
appropriate length. It is memory unsafe if the types of `imports` are
not what `module` expects.

The `imports` must be safely able to get inserted into `store`. This
only applies if `ImportSource::Definitions` is used because this will
internally call `Definition::to_extern` which requires that any
host functions in the list were created with an original `T` as the
store that's being inserted into.

The `imports` must all come from the `store` specified.
This function is unsafe for a few reasons . This assumes that ` imports ` has already been typechecked and is of the appropriate length . It is memory unsafe if the types of ` imports ` are not what ` module ` expects . The ` imports ` must be safely able to get inserted into ` store ` . This only applies if ` ImportSource :: Definitions ` is used because this will internally call ` Definition :: to_extern ` which requires that any host functions in the list were created with an original ` T ` as the store that ' s being inserted into . The ` imports ` must all come from the ` store ` specified .