std::ops::GeneratorState - Rust (original) (raw)
Enum std::ops::GeneratorState [−] [src]
#[lang = "generator_state"]
pub enum GeneratorState<Y, R> { Yielded(Y), Complete(R), }
🔬 This is a nightly-only experimental API. (generator_trait
#43122)
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
).
🔬 This is a nightly-only experimental API. (generator_trait
#43122)
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.
🔬 This is a nightly-only experimental API. (generator_trait
#43122)
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> Debug for GeneratorState<Y, R> where
`impl<Y, R> Hash for GeneratorState<Y, R> where
`impl<Y, R> Clone for GeneratorState<Y, R> where
`impl<Y, R> PartialOrd<GeneratorState<Y, R>> for GeneratorState<Y, R> where
R: PartialOrd,
Y: PartialOrd, `[src]
fn [partial_cmp](../../std/cmp/trait.PartialOrd.html#tymethod.partial%5Fcmp)(&self, __arg_0: &[GeneratorState](../../std/ops/enum.GeneratorState.html "enum std::ops::GeneratorState")<Y, R>) -> [Option](../../std/option/enum.Option.html "enum std::option::Option")<[Ordering](../../std/cmp/enum.Ordering.html "enum std::cmp::Ordering")>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn [lt](../../std/cmp/trait.PartialOrd.html#method.lt)(&self, __arg_0: &[GeneratorState](../../std/ops/enum.GeneratorState.html "enum std::ops::GeneratorState")<Y, R>) -> [bool](../primitive.bool.html)
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn [le](../../std/cmp/trait.PartialOrd.html#method.le)(&self, __arg_0: &[GeneratorState](../../std/ops/enum.GeneratorState.html "enum std::ops::GeneratorState")<Y, R>) -> [bool](../primitive.bool.html)
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn [gt](../../std/cmp/trait.PartialOrd.html#method.gt)(&self, __arg_0: &[GeneratorState](../../std/ops/enum.GeneratorState.html "enum std::ops::GeneratorState")<Y, R>) -> [bool](../primitive.bool.html)
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn [ge](../../std/cmp/trait.PartialOrd.html#method.ge)(&self, __arg_0: &[GeneratorState](../../std/ops/enum.GeneratorState.html "enum std::ops::GeneratorState")<Y, R>) -> [bool](../primitive.bool.html)
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
`impl<Y, R> Ord for GeneratorState<Y, R> where
`impl<Y, R> Eq for GeneratorState<Y, R> where
`impl<Y, R> PartialEq<GeneratorState<Y, R>> for GeneratorState<Y, R> where
R: PartialEq,
Y: PartialEq, `[src]