pub struct VmGenerator {
pub done: Rc<Cell<bool>>,
pub receiver: Rc<Mutex<Receiver<VmValue>>>,
}Expand description
A generator object: lazily produces values via yield. The generator body runs as a spawned task that sends values through a channel.
Fields§
§done: Rc<Cell<bool>>Whether the generator has finished (returned or exhausted).
receiver: Rc<Mutex<Receiver<VmValue>>>Receiver end of the yield channel (generator sends values here). Wrapped in a shared async mutex so recv() can be called without holding a RefCell borrow across await points.
Trait Implementations§
Source§impl Clone for VmGenerator
impl Clone for VmGenerator
Source§fn clone(&self) -> VmGenerator
fn clone(&self) -> VmGenerator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for VmGenerator
impl !RefUnwindSafe for VmGenerator
impl !Send for VmGenerator
impl !Sync for VmGenerator
impl Unpin for VmGenerator
impl UnsafeUnpin for VmGenerator
impl !UnwindSafe for VmGenerator
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