pub struct VmTask<'p> { /* private fields */ }Expand description
Drives one VM task on the scheduler. err_sink (first writer wins) receives
the task’s error if it fails.
Implementations§
Source§impl<'p> VmTask<'p>
impl<'p> VmTask<'p>
Sourcepub fn new(
vm: Vm<'p>,
output: Rc<RefCell<Vec<String>>>,
err_sink: Option<ErrSink>,
) -> Self
pub fn new( vm: Vm<'p>, output: Rc<RefCell<Vec<String>>>, err_sink: Option<ErrSink>, ) -> Self
A cooperative task draining into the shared output sink.
Sourcepub fn work_stealing(vm: Vm<'p>, err_sink: Option<ErrSink>) -> Self
pub fn work_stealing(vm: Vm<'p>, err_sink: Option<ErrSink>) -> Self
A work-stealing task: output buffers locally (reported via take_output),
and a spawn forwards a SpawnDesc the worker rebuilds — never a boxed body
(which is !Send and could not cross a worker boundary anyway).
Trait Implementations§
Source§impl<'p> Task<'p> for VmTask<'p>
impl<'p> Task<'p> for VmTask<'p>
Source§fn take_output(&mut self) -> Vec<String>
fn take_output(&mut self) -> Vec<String>
Hand the work-stealing coordinator this slice’s buffered output so it can be flushed in pick order. A no-op for cooperative tasks (they drain into the shared sink directly).
Auto Trait Implementations§
impl<'p> Freeze for VmTask<'p>
impl<'p> !RefUnwindSafe for VmTask<'p>
impl<'p> !Send for VmTask<'p>
impl<'p> !Sync for VmTask<'p>
impl<'p> Unpin for VmTask<'p>
impl<'p> UnsafeUnpin for VmTask<'p>
impl<'p> !UnwindSafe for VmTask<'p>
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.