Enum CoroutineState
pub enum CoroutineState<Y, R>
The result of a coroutine resumption.
This enum is returned from the Coroutine::resume method and indicates the
possible return values of a coroutine. Currently this corresponds to either
a suspension point (Yielded) or a termination point (Complete).
Variants
-
Yielded(Y) The coroutine suspended with a value.
This state indicates that a coroutine has been suspended, and typically corresponds to a
yieldstatement. The value provided in this variant corresponds to the expression passed toyieldand allows coroutines to provide a value each time they yield.-
Complete(R) The coroutine completed with a return value.
This state indicates that a coroutine has finished execution with the provided value. Once a coroutine has returned
Completeit is considered a programmer error to callresumeagain.
Trait Implementations
impl<Y: Clone, R: Clone> Clone for CoroutineState<Y, R>
fn clone(&self) -> CoroutineState<Y, R>
impl<Y: Copy, R: Copy> Copy for CoroutineState<Y, R>
impl<Y: Debug, R: Debug> Debug for CoroutineState<Y, R>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<Y: Eq, R: Eq> Eq for CoroutineState<Y, R>
fn assert_fields_are_eq(&self)
impl<Y: Hash, R: Hash> Hash for CoroutineState<Y, R>
fn hash<__H: Hasher>(&self, state: &mut __H)
impl<Y: Ord, R: Ord> Ord for CoroutineState<Y, R>
fn cmp(&self, other: &CoroutineState<Y, R>) -> Ordering
impl<Y: PartialEq, R: PartialEq> PartialEq for CoroutineState<Y, R>
fn eq(&self, other: &CoroutineState<Y, R>) -> bool
impl<Y: PartialEq, R: PartialEq> StructuralPartialEq for CoroutineState<Y, R>
impl<Y: PartialOrd, R: PartialOrd> PartialOrd for CoroutineState<Y, R>
fn partial_cmp(&self, other: &CoroutineState<Y, R>) -> Option<Ordering>
Auto Trait Implementations
impl<Y, R> Freeze for CoroutineState<Y, R>
where
Y: Freeze,
R: Freeze,
impl<Y, R> RefUnwindSafe for CoroutineState<Y, R>
where
Y: RefUnwindSafe,
R: RefUnwindSafe,
impl<Y, R> Send for CoroutineState<Y, R>
where
Y: Send,
R: Send,
impl<Y, R> Sync for CoroutineState<Y, R>
where
Y: Sync,
R: Sync,
impl<Y, R> Unpin for CoroutineState<Y, R>
where
Y: Unpin,
R: Unpin,
impl<Y, R> UnsafeUnpin for CoroutineState<Y, R>
where
Y: UnsafeUnpin,
R: UnsafeUnpin,
impl<Y, R> UnwindSafe for CoroutineState<Y, R>
where
Y: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
impl<T> Any for CoroutineState<Y, R>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for CoroutineState<Y, R>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for CoroutineState<Y, R>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for CoroutineState<Y, R>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for CoroutineState<Y, R>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Printable for CoroutineState<Y, R>
where
T: Copy + Debug,
impl<T> SizeHint for CoroutineState<Y, R>
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for CoroutineState<Y, R>
impl<T, U> Into<U> for CoroutineState<Y, R>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for CoroutineState<Y, R>
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for CoroutineState<Y, R>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>