pub fn async_complete(
        mut self,
    ) -> impl Future<Output = Result<Value, VmError>> + Send + 'static {
        let future = async move {
            let result = self.0.async_resume().await?;

            match result {
                GeneratorState::Complete(value) => Ok(value),
                GeneratorState::Yielded(..) => Err(VmError::from(VmErrorKind::Halted {
                    halt: VmHaltInfo::Yielded,
                })),
            }
        };

        // Safety: we wrap all APIs around the [VmExecution], preventing values
        // from escaping from contained virtual machine.
        unsafe { internal::AssertSend::new(future) }
    }
/// Complete the current execution with support for async instructions.
///
/// This requires that the result of the Vm is converted into a
/// [crate::FromValue] that also implements [Send],  which prevents non-Send
/// values from escaping from the virtual machine.
Complete the current execution with support for async instructions.
This requires that the result of the Vm is converted into a
[crate::FromValue] that also implements [Send],  which prevents non-Send
values from escaping from the virtual machine.
Complete the current execution with support for async instructions . This requires that the result of the Vm is converted into a [ crate :: FromValue ] that also implements [ Send ] which prevents non - Send values from escaping from the virtual machine .
pub fn async_complete(
        mut self,
    ) -> impl Future<Output = Result<Value, VmError>> + Send + 'static {
        let future = async move {
            let result = self.0.async_resume().await?;
            match result {
                GeneratorState::Complete(value) => Ok(value),
                GeneratorState::Yielded(..) => Err(VmError::from(VmErrorKind::Halted {
                    halt: VmHaltInfo::Yielded,
                })),
            }
        };
        // Safety: we wrap all APIs around the [VmExecution], preventing values
        // from escaping from contained virtual machine.
        unsafe { internal::AssertSend::new(future) }
    }
pub fn async_complete ( mut self , ) -> impl Future < Output = Result < Value , VmError > > + Send + ' static { let future = async move { let result = self . 0 . async_resume ( ) . await ? ; match result { GeneratorState :: Complete ( value ) => Ok ( value ) , GeneratorState :: Yielded ( .. ) => Err ( VmError :: from ( VmErrorKind :: Halted { halt : VmHaltInfo :: Yielded , } ) ) , } } ; // Safety: we wrap all APIs around the [VmExecution], preventing values // from escaping from contained virtual machine. unsafe { internal :: AssertSend :: new ( future ) } }
Complete the current execution with support for async instructions.
Complete the current execution with support for async instructions .
mut self
mut self