[−][src]Trait generator_extensions::IntoGenerator
This trait represents a value which can be transformed into a Generator
.
Currently, this trait is blanket implemented for all Iterator
types as
well as for the Gen
wrapper type.
To take advantage of these extension methods, simply write:
use generator_extensions::IntoGenerator;
Or, preferably:
use generator_extensions::prelude::*;
Notes
This trait is unfortunately not implemented for compiler-generated types, as those desugared types could theoretically implement multiple distinct generator traits. This does not occur today and is very unlikely to occur in the future, but the Rust trait system is rightly unable to express this fact.
To work around this, the newtype wrapper Gen
is provided by this crate.
Associated Types
type Resume
[src]
The argument to resume the generator.
type Yield
[src]
The type of value the generator yields.
type Return
[src]
The type of value the generator returns.
type Generator: Generator<Self::Resume, Yield = Self::Yield, Return = Self::Return>
[src]
Type full type of the generator.
Required methods
#[must_use]pub fn into_generator(self) -> Self::Generator
[src]
Convert this value into a Generator
.