Skip to main content

VmSendExecution

Struct 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

Source

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.

Source

pub fn async_complete( self, ) -> impl Future<Output = Result<Value, VmError>> + Send + 'static

👎Deprecated:

Use VmSendExecution::complete

Source

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.

Source

pub fn async_complete_with_diagnostics( self, diagnostics: &mut dyn VmDiagnostics, ) -> impl Future<Output = Result<Value, VmError>> + Send + '_

👎Deprecated:

Use VmSendExecution::complete_with_diagnostics

Trait Implementations§

Auto Trait Implementations§

§

impl !RefUnwindSafe for VmSendExecution

§

impl !Sync for VmSendExecution

§

impl !UnwindSafe for VmSendExecution

§

impl Forget for VmSendExecution

§

impl Freeze for VmSendExecution
where *const ArcInner<RuntimeContext> is !null: Freeze, PhantomData<ArcInner<RuntimeContext>>: Freeze, *const ArcInner<Unit> is !null: Freeze, PhantomData<ArcInner<Unit>>: Freeze, *const Value is !null: Freeze, PhantomData<Value>: Freeze, *const CallFrame is !null: Freeze, PhantomData<CallFrame>: Freeze, *const RcInner<GlobalsInner> is !null: Freeze, PhantomData<RcInner<GlobalsInner>>: Freeze, *const AnySequenceData<Arc<Rtti>, Value> is !null: Freeze, *const AnyObjData is !null: Freeze, *const u8 is !null: Freeze, PhantomData<Repr>: Freeze, *const VmExecutionState is !null: Freeze, PhantomData<VmExecutionState>: Freeze,

§

impl Move for VmSendExecution

§

impl Unpin for VmSendExecution
where *const ArcInner<RuntimeContext> is !null: Unpin, Align8<usize>: Unpin, *const u8 is !null: Unpin, *const () is !null: Unpin, &'static FunctionHandlerVTable: Unpin, Box<str>: Unpin, Box<[u8]>: Unpin, Box<[Box<str>]>: Unpin, Box<[ConstNode]>: Unpin, &'static ConstConstructVtable: Unpin, *const ArcInner<Unit> is !null: Unpin, *const Inst is !null: Unpin, NonZero<usize>: Unpin, *const Arc<StaticString> is !null: Unpin, *const ArcInner<StaticString> is !null: Unpin, *const Vec<u8> is !null: Unpin, *const Box<[String]> is !null: Unpin, Box<[String]>: Unpin, *const Arc<[Address]> is !null: Unpin, *const ArcInner<[Address]> is !null: Unpin, *const ArcInner<Rtti> is !null: Unpin, *const Option<ConstValueBuf> is !null: Unpin, Box<DebugInfo>: Unpin, *const Value is !null: Unpin, *const AnySequenceData<Arc<Rtti>, Value> is !null: Unpin, *const AnyObjData is !null: Unpin, *const CallFrame is !null: Unpin, Rc<GlobalsInner>: Unpin, *const VmExecutionState is !null: Unpin,

§

impl UnsafeUnpin for VmSendExecution
where *const ArcInner<RuntimeContext> is !null: UnsafeUnpin, PhantomData<ArcInner<RuntimeContext>>: UnsafeUnpin, *const ArcInner<Unit> is !null: UnsafeUnpin, PhantomData<ArcInner<Unit>>: UnsafeUnpin, *const Value is !null: UnsafeUnpin, PhantomData<Value>: UnsafeUnpin, *const CallFrame is !null: UnsafeUnpin, PhantomData<CallFrame>: UnsafeUnpin, *const RcInner<GlobalsInner> is !null: UnsafeUnpin, PhantomData<RcInner<GlobalsInner>>: UnsafeUnpin, *const AnySequenceData<Arc<Rtti>, Value> is !null: UnsafeUnpin, *const AnyObjData is !null: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<Repr>: UnsafeUnpin, *const VmExecutionState is !null: UnsafeUnpin, PhantomData<VmExecutionState>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more