Enum CoroutineState

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 yield statement. The value provided in this variant corresponds to the expression passed to yield and 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 Complete it is considered a programmer error to call resume again.

Implementations

impl<T> Any for CoroutineState<Y, R>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for CoroutineState<Y, R>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for CoroutineState<Y, R>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for CoroutineState<Y, R>

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for CoroutineState<Y, R>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for CoroutineState<Y, R>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for CoroutineState<Y, R>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for CoroutineState<Y, R>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>

impl<Y, R> Freeze for CoroutineState<Y, R>

impl<Y, R> RefUnwindSafe for CoroutineState<Y, R>

impl<Y, R> Send for CoroutineState<Y, R>

impl<Y, R> StructuralPartialEq for CoroutineState<Y, R>

impl<Y, R> Sync for CoroutineState<Y, R>

impl<Y, R> Unpin for CoroutineState<Y, R>

impl<Y, R> UnsafeUnpin for CoroutineState<Y, R>

impl<Y, R> UnwindSafe for CoroutineState<Y, R>

impl<Y: $crate::clone::Clone, R: $crate::clone::Clone> Clone for CoroutineState<Y, R>

fn clone(self: &Self) -> CoroutineState<Y, R>

impl<Y: $crate::cmp::Eq, R: $crate::cmp::Eq> Eq for CoroutineState<Y, R>

impl<Y: $crate::cmp::Ord, R: $crate::cmp::Ord> Ord for CoroutineState<Y, R>

fn cmp(self: &Self, other: &CoroutineState<Y, R>) -> Ordering

impl<Y: $crate::cmp::PartialEq, R: $crate::cmp::PartialEq> PartialEq for CoroutineState<Y, R>

fn eq(self: &Self, other: &CoroutineState<Y, R>) -> bool

impl<Y: $crate::cmp::PartialOrd, R: $crate::cmp::PartialOrd> PartialOrd for CoroutineState<Y, R>

fn partial_cmp(self: &Self, other: &CoroutineState<Y, R>) -> Option<Ordering>

impl<Y: $crate::fmt::Debug, R: $crate::fmt::Debug> Debug for CoroutineState<Y, R>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<Y: $crate::hash::Hash, R: $crate::hash::Hash> Hash for CoroutineState<Y, R>

fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)

impl<Y: $crate::marker::Copy, R: $crate::marker::Copy> Copy for CoroutineState<Y, R>