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 complete(
self,
) -> impl Future<Output = Result<Value, VmError>> + Send + 'static
pub fn complete( self, ) -> impl Future<Output = Result<Value, VmError>> + 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(
self,
) -> impl Future<Output = Result<Value, VmError>> + Send + 'static
👎Deprecated: Use VmSendExecution::complete
pub fn async_complete( self, ) -> impl Future<Output = Result<Value, VmError>> + Send + 'static
VmSendExecution::completeAlias for VmSendExecution::complete.
Sourcepub fn complete_with_diagnostics(
self,
diagnostics: &mut dyn VmDiagnostics,
) -> impl Future<Output = Result<Value, VmError>> + Send + '_
pub fn complete_with_diagnostics( self, diagnostics: &mut dyn VmDiagnostics, ) -> impl Future<Output = Result<Value, VmError>> + 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.
Sourcepub fn async_complete_with_diagnostics(
self,
diagnostics: &mut dyn VmDiagnostics,
) -> impl Future<Output = Result<Value, VmError>> + Send + '_
👎Deprecated: Use VmSendExecution::complete_with_diagnostics
pub fn async_complete_with_diagnostics( self, diagnostics: &mut dyn VmDiagnostics, ) -> impl Future<Output = Result<Value, VmError>> + Send + '_
VmSendExecution::complete_with_diagnosticsAlias for VmSendExecution::complete_with_diagnostics.