pub struct CoroutineFrame<T = Ref> { /* private fields */ }Expand description
A resumable producer/consumer frame for control libraries.
The frame alternates between produced and consumed values while either side has work remaining. It carries no language-specific status names, so codec and language layers can map the generic steps into their own surfaces.
Implementations§
Source§impl<T> CoroutineFrame<T>
impl<T> CoroutineFrame<T>
Sourcepub fn new(produced: Vec<T>, consumed: Vec<T>) -> Self
pub fn new(produced: Vec<T>, consumed: Vec<T>) -> Self
Builds a frame from producer-side and consumer-side values.
Sourcepub fn resume(&mut self) -> CoroutineFrameStep<T>where
T: Clone,
pub fn resume(&mut self) -> CoroutineFrameStep<T>where
T: Clone,
Resumes the frame, returning the next producer or consumer transition.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Returns whether both producer and consumer sides are exhausted.
Trait Implementations§
Source§impl<T: Clone> Clone for CoroutineFrame<T>
impl<T: Clone> Clone for CoroutineFrame<T>
Source§fn clone(&self) -> CoroutineFrame<T>
fn clone(&self) -> CoroutineFrame<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for CoroutineFrame<T>
impl<T: Debug> Debug for CoroutineFrame<T>
impl<T: Eq> Eq for CoroutineFrame<T>
Source§impl<T: PartialEq> PartialEq for CoroutineFrame<T>
impl<T: PartialEq> PartialEq for CoroutineFrame<T>
impl<T: PartialEq> StructuralPartialEq for CoroutineFrame<T>
Auto Trait Implementations§
impl<T> Freeze for CoroutineFrame<T>
impl<T> RefUnwindSafe for CoroutineFrame<T>where
T: RefUnwindSafe,
impl<T> Send for CoroutineFrame<T>where
T: Send,
impl<T> Sync for CoroutineFrame<T>where
T: Sync,
impl<T> Unpin for CoroutineFrame<T>where
T: Unpin,
impl<T> UnsafeUnpin for CoroutineFrame<T>
impl<T> UnwindSafe for CoroutineFrame<T>where
T: UnwindSafe,
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