pub enum CoroutineState<Y, R> {
Yielded(Y),
Complete(R),
}coroutine_trait)Expand description
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)
coroutine_trait)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)
coroutine_trait)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.
Trait Implementationsยง
Sourceยงimpl<Y, R> Clone for CoroutineState<Y, R>
impl<Y, R> Clone for CoroutineState<Y, R>
Sourceยงfn clone(&self) -> CoroutineState<Y, R>
fn clone(&self) -> CoroutineState<Y, R>
1.0.0 ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSourceยงimpl<Y, R> Debug for CoroutineState<Y, R>
impl<Y, R> Debug for CoroutineState<Y, R>
Sourceยงimpl<Y, R> Hash for CoroutineState<Y, R>
impl<Y, R> Hash for CoroutineState<Y, R>
Sourceยงimpl<Y, R> Ord for CoroutineState<Y, R>
impl<Y, R> Ord for CoroutineState<Y, R>
Sourceยงfn cmp(&self, other: &CoroutineState<Y, R>) -> Ordering
fn cmp(&self, other: &CoroutineState<Y, R>) -> Ordering
1.21.0 ยท Sourceยงfn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Sourceยงimpl<Y, R> PartialEq for CoroutineState<Y, R>
impl<Y, R> PartialEq for CoroutineState<Y, R>
Sourceยงimpl<Y, R> PartialOrd for CoroutineState<Y, R>where
Y: PartialOrd,
R: PartialOrd,
impl<Y, R> PartialOrd for CoroutineState<Y, R>where
Y: PartialOrd,
R: PartialOrd,
impl<Y, R> Copy for CoroutineState<Y, R>
impl<Y, R> Eq for CoroutineState<Y, R>
impl<Y, R> StructuralPartialEq for CoroutineState<Y, R>
Auto Trait Implementationsยง
impl<Y, R> Freeze for CoroutineState<Y, R>
impl<Y, R> RefUnwindSafe for CoroutineState<Y, R>where
Y: RefUnwindSafe,
R: RefUnwindSafe,
impl<Y, R> Send for CoroutineState<Y, R>
impl<Y, R> Sync for CoroutineState<Y, R>
impl<Y, R> Unpin for CoroutineState<Y, R>
impl<Y, R> UnwindSafe for CoroutineState<Y, R>where
Y: UnwindSafe,
R: 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
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<T> DTypePromoteAPI<T> for T
impl<T> DTypePromoteAPI<T> for T
const SAME_TYPE: bool = true
const CAN_CAST_SELF: bool = true
const CAN_CAST_OTHER: bool = true
type Res = T
fn promote_self(self) -> <T as DTypePromoteAPI<T>>::Res
fn promote_other(val: T) -> <T as DTypePromoteAPI<T>>::Res
fn promote_pair(self, val: T) -> (Self::Res, Self::Res)where
Self: Sized,
Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more