pub struct VmFiber { /* private fields */ }Expand description
Host-independent lifetime for resumable bytecode execution. The machine owns every frame, local, operand and handler needed to continue.
Implementations§
Source§impl VmFiber
impl VmFiber
pub fn start(program: Rc<Program>) -> Self
Sourcepub fn start_call(
program: Rc<Program>,
prototype: u16,
arguments: Vec<Value>,
captures: Vec<Value>,
) -> Self
pub fn start_call( program: Rc<Program>, prototype: u16, arguments: Vec<Value>, captures: Vec<Value>, ) -> Self
Starts a specific validated prototype with direct arguments and captures. Prepared embedding calls use this to avoid namespace-backed request bindings and synthetic source compilation.
pub fn state(&self) -> VmFiberState
pub fn pending(&self) -> Option<Promise>
pub fn resume(&mut self, state: PromiseState) -> VmFiberState
pub fn resume_yield(&mut self, value: Value) -> VmFiberState
Sourcepub fn poll(&mut self) -> VmFiberState
pub fn poll(&mut self) -> VmFiberState
Drains queued child resumptions and advances this fiber when its awaited promise became settled. Hosts call this from their event loop.
pub fn cancel(&mut self) -> bool
pub fn drive_sync(&mut self) -> Result<Value, VmError>
Auto Trait Implementations§
impl !RefUnwindSafe for VmFiber
impl !Send for VmFiber
impl !Sync for VmFiber
impl !UnwindSafe for VmFiber
impl Freeze for VmFiber
impl Unpin for VmFiber
impl UnsafeUnpin for VmFiber
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more