pub fn resume(&mut self) -> Result<GeneratorState, VmError> {
        loop {
            let len = self.vms.len();
            let vm = self.vm_mut()?;

            match Self::run(vm)? {
                VmHalt::Exited => (),
                VmHalt::VmCall(vm_call) => {
                    vm_call.into_execution(self)?;
                    continue;
                }
                VmHalt::Yielded => return Ok(GeneratorState::Yielded(vm.stack_mut().pop()?)),
                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(), "the final vm should be empty");
                self.vms.clear();
                return Ok(GeneratorState::Complete(value));
            }

            self.pop_vm()?;
        }
    }
/// Resume the current execution without support for async instructions.
///
/// If any async instructions are encountered, this will error.
Resume the current execution without support for async instructions.
If any async instructions are encountered, this will error.
Resume the current execution without support for async instructions . If any async instructions are encountered this will error .
pub fn resume(&mut self) -> Result<GeneratorState, VmError> {
        loop {
            let len = self.vms.len();
            let vm = self.vm_mut()?;
            match Self::run(vm)? {
                VmHalt::Exited => (),
                VmHalt::VmCall(vm_call) => {
                    vm_call.into_execution(self)?;
                    continue;
                }
                VmHalt::Yielded => return Ok(GeneratorState::Yielded(vm.stack_mut().pop()?)),
                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(), "the final vm should be empty");
                self.vms.clear();
                return Ok(GeneratorState::Complete(value));
            }
            self.pop_vm()?;
        }
    }
pub fn resume ( & mut self ) -> Result < GeneratorState , VmError > { loop { let len = self . vms . len ( ) ; let vm = self . vm_mut ( ) ? ; match Self :: run ( vm ) ? { VmHalt :: Exited => ( ) , VmHalt :: VmCall ( vm_call ) => { vm_call . into_execution ( self ) ? ; continue ; } VmHalt :: Yielded => return Ok ( GeneratorState :: Yielded ( vm . stack_mut ( ) . pop ( ) ? ) ) , 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 ( ) " " ) ; self . vms . clear ( ) ; return Ok ( GeneratorState :: Complete ( value ) ) ; } self . pop_vm ( ) ? ; } }
Resume the current execution without support for async instructions.
Resume the current execution without support for async instructions .
&mut self
&mut self