pub struct VmSendExecution(/* private fields */);
Expand description
A wrapper that makes VmExecution
Send
.
This is accomplished by preventing any Value
from escaping the Vm
.
As long as this is maintained, it is safe to send the execution across,
threads, and therefore schedule the future associated with the execution on
a thread pool like Tokio’s through tokio::spawn.
Implementations§
Source§impl VmSendExecution
impl VmSendExecution
Sourcepub fn async_complete(
self,
) -> impl Future<Output = VmResult<Value>> + Send + 'static
pub fn async_complete( self, ) -> impl Future<Output = VmResult<Value>> + Send + 'static
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.
Sourcepub fn async_complete_with_diagnostics(
self,
diagnostics: Option<&mut dyn VmDiagnostics>,
) -> impl Future<Output = VmResult<Value>> + Send + '_
pub fn async_complete_with_diagnostics( self, diagnostics: Option<&mut dyn VmDiagnostics>, ) -> impl Future<Output = VmResult<Value>> + Send + '_
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.