#[lang = "generator_state"]pub enum GeneratorState<Y, R> { Yielded(Y), Complete(R), }
The result of a generator resumption.
This enum is returned from the Generator::resume
method and indicates the possible return values of a generator. Currently this corresponds to either a suspension point (Yielded
) or a termination point (Complete
).
Yielded(Y)
The generator suspended with a value.
This state indicates that a generator 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 generators to provide a value each time they yield.
Complete(R)
The generator completed with a return value.
This state indicates that a generator has finished execution with the provided value. Once a generator has returned Complete
it is considered a programmer error to call resume
again.
impl<Y, R> Clone for GeneratorState<Y, R> where
    R: Clone,
    Y: Clone,Â
[src]
fn clone(&self) -> GeneratorState<Y, R>
[src]
fn clone_from(&mut self, source: &Self)
[src]1.0.0
impl<Y, R> Copy for GeneratorState<Y, R> where
    R: Copy,
    Y: Copy,Â
[src]
impl<Y, R> Debug for GeneratorState<Y, R> where
    R: Debug,
    Y: Debug,Â
[src]
impl<Y, R> Eq for GeneratorState<Y, R> where
    R: Eq,
    Y: Eq,Â
[src]
impl<Y, R> Hash for GeneratorState<Y, R> where
    R: Hash,
    Y: Hash,Â
[src]
fn hash<__H>(&self, state: &mut __H) where
    __H: Hasher,Â
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher,Â
[src]1.3.0
impl<Y, R> Ord for GeneratorState<Y, R> where
    R: Ord,
    Y: Ord,Â
[src]
fn cmp(&self, other: &GeneratorState<Y, R>) -> Ordering
[src]
fn max(self, other: Self) -> Self
[src]1.21.0
fn min(self, other: Self) -> Self
[src]1.21.0
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<Y, R> PartialEq<GeneratorState<Y, R>> for GeneratorState<Y, R> where
    R: PartialEq<R>,
    Y: PartialEq<Y>,Â
[src]
fn eq(&self, other: &GeneratorState<Y, R>) -> bool
[src]
fn ne(&self, other: &GeneratorState<Y, R>) -> bool
[src]
impl<Y, R> PartialOrd<GeneratorState<Y, R>> for GeneratorState<Y, R> where
    R: PartialOrd<R>,
    Y: PartialOrd<Y>,Â
[src]
fn partial_cmp(&self, other: &GeneratorState<Y, R>) -> Option<Ordering>
[src]
fn lt(&self, other: &GeneratorState<Y, R>) -> bool
[src]
fn le(&self, other: &GeneratorState<Y, R>) -> bool
[src]
fn gt(&self, other: &GeneratorState<Y, R>) -> bool
[src]
fn ge(&self, other: &GeneratorState<Y, R>) -> bool
[src]
impl<Y, R> StructuralEq for GeneratorState<Y, R>
[src]
impl<Y, R> StructuralPartialEq for GeneratorState<Y, R>
[src]
impl<Y, R> RefUnwindSafe for GeneratorState<Y, R> where
    R: RefUnwindSafe,
    Y: RefUnwindSafe,Â
impl<Y, R> Send for GeneratorState<Y, R> where
    R: Send,
    Y: Send,Â
impl<Y, R> Sync for GeneratorState<Y, R> where
    R: Sync,
    Y: Sync,Â
impl<Y, R> Unpin for GeneratorState<Y, R> where
    R: Unpin,
    Y: Unpin,Â
impl<Y, R> UnwindSafe for GeneratorState<Y, R> where
    R: UnwindSafe,
    Y: UnwindSafe,Â
impl<T> Any for T where
    T: 'static + ?Sized,Â
[src]
impl<T> Borrow<T> for T where
    T: ?Sized,Â
[src]
fn borrow(&self) -> &TⓘNotable traits for &'_ mut F
impl<'_, F> Future for &'_ mut F where
    F: Unpin + Future + ?Sized,Â
type Output = <F as Future>::Output;
impl<'_, I> Iterator for &'_ mut I where
    I: Iterator + ?Sized,Â
type Item = <I as Iterator>::Item;
impl<R:Â Read + ?Sized, '_> Read for &'_ mut R
impl<W:Â Write + ?Sized, '_> Write for &'_ mut W
[src]
impl<T> BorrowMut<T> for T where
    T: ?Sized,Â
[src]
fn borrow_mut(&mut self) -> &mut TⓘNotable traits for &'_ mut F
impl<'_, F> Future for &'_ mut F where
    F: Unpin + Future + ?Sized,Â
type Output = <F as Future>::Output;
impl<'_, I> Iterator for &'_ mut I where
    I: Iterator + ?Sized,Â
type Item = <I as Iterator>::Item;
impl<R:Â Read + ?Sized, '_> Read for &'_ mut R
impl<W:Â Write + ?Sized, '_> Write for &'_ mut W
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
    U: From<T>,Â
[src]
impl<T> ToOwned for T where
    T: Clone,Â
[src]
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
    U: Into<T>,Â
[src]
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
    U: TryFrom<T>,Â
[src]
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/ops/enum.GeneratorState.html