pub async fn async_step(&mut self) -> Result<Option<Value>, VmError> {
        let len = self.vms.len();
        let vm = self.vm_mut()?;

        match budget::with(1, || Self::run(vm)).call()? {
            VmHalt::Exited => (),
            VmHalt::Awaited(awaited) => {
                awaited.into_vm(vm).await?;
                return Ok(None);
            }
            VmHalt::VmCall(vm_call) => {
                vm_call.into_execution(self)?;
                return Ok(None);
            }
            VmHalt::Limited => return Ok(None),
            halt => {
                return Err(VmError::from(VmErrorKind::Halted {
                    halt: halt.into_info(),
                }))
            }
        }

        if len == 1 {
            let value = vm.stack_mut().pop()?;
            debug_assert!(vm.stack().is_empty(), "final vm stack not clean");
            return Ok(Some(value));
        }

        self.pop_vm()?;
        Ok(None)
    }
/// Step the single execution for one step with support for async
/// instructions.
Step the single execution for one step with support for async
instructions.
Step the single execution for one step with support for async instructions .
pub async fn async_step(&mut self) -> Result<Option<Value>, VmError> {
        let len = self.vms.len();
        let vm = self.vm_mut()?;
        match budget::with(1, || Self::run(vm)).call()? {
            VmHalt::Exited => (),
            VmHalt::Awaited(awaited) => {
                awaited.into_vm(vm).await?;
                return Ok(None);
            }
            VmHalt::VmCall(vm_call) => {
                vm_call.into_execution(self)?;
                return Ok(None);
            }
            VmHalt::Limited => return Ok(None),
            halt => {
                return Err(VmError::from(VmErrorKind::Halted {
                    halt: halt.into_info(),
                }))
            }
        }
        if len == 1 {
            let value = vm.stack_mut().pop()?;
            debug_assert!(vm.stack().is_empty(), "final vm stack not clean");
            return Ok(Some(value));
        }
        self.pop_vm()?;
        Ok(None)
    }
pub async fn async_step ( & mut self ) -> Result < Option < Value > , VmError > { let len = self . vms . len ( ) ; let vm = self . vm_mut ( ) ? ; match budget :: with ( 1 , | | Self :: run ( vm ) ) . call ( ) ? { VmHalt :: Exited => ( ) , VmHalt :: Awaited ( awaited ) => { awaited . into_vm ( vm ) . await ? ; return Ok ( None ) ; } VmHalt :: VmCall ( vm_call ) => { vm_call . into_execution ( self ) ? ; return Ok ( None ) ; } VmHalt :: Limited => return Ok ( None ) , halt => { return Err ( VmError :: from ( VmErrorKind :: Halted { halt : halt . into_info ( ) , } ) ) } } if len == 1 { let value = vm . stack_mut ( ) . pop ( ) ? ; debug_assert ! ( vm stack ( ) is_empty ( ) " " ) ; return Ok ( Some ( value ) ) ; } self . pop_vm ( ) ? ; Ok ( None ) }
Step the single execution for one step with support for async
instructions.
Step the single execution for one step with support for async instructions .
&mut self
&mut self