Struct rune::runtime::VmSendExecution
source · 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.
Trait Implementations§
impl Send for VmSendExecution
Auto Trait Implementations§
impl !RefUnwindSafe for VmSendExecution
impl !Sync for VmSendExecution
impl Unpin for VmSendExecution
impl !UnwindSafe for VmSendExecution
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more