fn module(&mut self, instance_name: Option<&str>, module: &[u8]) -> Result<()> {
        let instance = match self.instantiate(module)? {
            Outcome::Ok(i) => i,
            Outcome::Trap(e) => bail!("instantiation failed with: {}", e.borrow().message()),
        };
        if let Some(name) = instance_name {
            self.instances.insert(name.to_string(), instance.clone());
        }
        self.current = Some(instance);
        Ok(())
    }
/// Define a module and register it.
Define a module and register it.
Define a module and register it .
fn module(&mut self, instance_name: Option<&str>, module: &[u8]) -> Result<()> {
        let instance = match self.instantiate(module)? {
            Outcome::Ok(i) => i,
            Outcome::Trap(e) => bail!("instantiation failed with: {}", e.borrow().message()),
        };
        if let Some(name) = instance_name {
            self.instances.insert(name.to_string(), instance.clone());
        }
        self.current = Some(instance);
        Ok(())
    }
fn module ( & mut self , instance_name : Option < & str > , module : & [ u8 ] ) -> Result < ( ) > { let instance = match self . instantiate ( module ) ? { Outcome :: Ok ( i ) => i , Outcome :: Trap ( e ) => bail ! ( " " e borrow ( ) message ( ) ) , } ; if let Some ( name ) = instance_name { self . instances . insert ( name . to_string ( ) , instance . clone ( ) ) ; } self . current = Some ( instance ) ; Ok ( ( ) ) }
Define a module and register it.
Define a module and register it .
&mut self
instance_name
Option<&str>
module
&[u8]
&mut self
instance_name
Option<&str>
module
&[u8]