fn validate_init_func(&self, module: &wasmtime::Module) -> anyhow::Result<()> {
        log::debug!("Validating the exported initialization function");
        match module.get_export(&self.init_func) {
            Some(wasmtime::ExternType::Func(func_ty)) => {
                if func_ty.params().len() != 0 || func_ty.results().len() != 0 {
                    anyhow::bail!(
                        "the Wasm module's `{}` function export does not have type `[] -> []`",
                        &self.init_func
                    );
                }
            }
            Some(_) => anyhow::bail!(
                "the Wasm module's `{}` export is not a function",
                &self.init_func
            ),
            None => anyhow::bail!(
                "the Wasm module does not have a `{}` export",
                &self.init_func
            ),
        }
        Ok(())
    }
/// Check that the module exports an initialization function, and that the
/// function has the correct type.
Check that the module exports an initialization function, and that the
function has the correct type.
Check that the module exports an initialization function and that the function has the correct type .
fn validate_init_func(&self, module: &wasmtime::Module) -> anyhow::Result<()> {
        log::debug!("Validating the exported initialization function");
        match module.get_export(&self.init_func) {
            Some(wasmtime::ExternType::Func(func_ty)) => {
                if func_ty.params().len() != 0 || func_ty.results().len() != 0 {
                    anyhow::bail!(
                        "the Wasm module's `{}` function export does not have type `[] -> []`",
                        &self.init_func
                    );
                }
            }
            Some(_) => anyhow::bail!(
                "the Wasm module's `{}` export is not a function",
                &self.init_func
            ),
            None => anyhow::bail!(
                "the Wasm module does not have a `{}` export",
                &self.init_func
            ),
        }
        Ok(())
    }
fn validate_init_func ( & self , module : & wasmtime :: Module ) -> anyhow :: Result < ( ) > { log :: debug ! ( " " ) ; match module . get_export ( & self . init_func ) { Some ( wasmtime :: ExternType :: Func ( func_ty ) ) => { if func_ty . params ( ) . len ( ) != 0 || func_ty . results ( ) . len ( ) != 0 { anyhow :: bail ! ( " " self init_func ) ; } } Some ( _ ) => anyhow :: bail ! ( " " self init_func ) , None => anyhow :: bail ! ( " " self init_func ) , } Ok ( ( ) ) }
Check that the module exports an initialization function, and that the
function has the correct type.
Check that the module exports an initialization function and that the function has the correct type .
&self
module
&wasmtime::Module
&self
module
&wasmtime::Module