pub fn new<'data>(
        compiler: &mut Compiler,
        data: &'data [u8],
        resolver: &mut dyn Resolver,
    ) -> Result<Self, SetupError> {
        let raw = RawCompiledModule::<'data>::new(compiler, data, resolver)?;

        Ok(Self {
            module: Rc::new(raw.module),
            finished_functions: raw.finished_functions,
            imports: raw.imports,
            data_initializers: raw
                .data_initializers
                .iter()
                .map(OwnedDataInitializer::new)
                .collect::<Vec<_>>()
                .into_boxed_slice(),
            signatures: raw.signatures.clone(),
        })
    }
/// Compile a data buffer into a `CompiledModule`, which may then be instantiated.
Compile a data buffer into a `CompiledModule`, which may then be instantiated.
Compile a data buffer into a ` CompiledModule ` which may then be instantiated .
pub fn new<'data>(
        compiler: &mut Compiler,
        data: &'data [u8],
        resolver: &mut dyn Resolver,
    ) -> Result<Self, SetupError> {
        let raw = RawCompiledModule::<'data>::new(compiler, data, resolver)?;
        Ok(Self {
            module: Rc::new(raw.module),
            finished_functions: raw.finished_functions,
            imports: raw.imports,
            data_initializers: raw
                .data_initializers
                .iter()
                .map(OwnedDataInitializer::new)
                .collect::<Vec<_>>()
                .into_boxed_slice(),
            signatures: raw.signatures.clone(),
        })
    }
pub fn new < ' data > ( compiler : & mut Compiler , data : & ' data [ u8 ] , resolver : & mut dyn Resolver , ) -> Result < Self , SetupError > { let raw = RawCompiledModule :: < ' data > :: new ( compiler , data , resolver ) ? ; Ok ( Self { module : Rc :: new ( raw . module ) , finished_functions : raw . finished_functions , imports : raw . imports , data_initializers : raw . data_initializers . iter ( ) . map ( OwnedDataInitializer :: new ) . collect :: < Vec < _ > > ( ) . into_boxed_slice ( ) , signatures : raw . signatures . clone ( ) , } ) }
Compile a data buffer into a `CompiledModule`, which may then be instantiated.
Compile a data buffer into a ` CompiledModule ` which may then be instantiated .
compiler
&mut Compiler
data
&'data [u8]
resolver
&mut dyn Resolver