[−][src]Crate generator_extensions
generator_extensions
provides a set of blanket-implemented traits which
provide parity between Generator
s and Iterator
s.
To take advantage of the blanket implementations, simply write the following, which imports all of the extension traits into the current scope:
use generator_extensions::prelude::*;
The two extension traits provided by generator_extensions
are
Resumable
, which represents a resumable reference to a Generator
,
and IntoGenerator
which represents a type which can be converted into a
Generator
.
The Resumable
trait provides extension methods to unify Resumable and
Unpin
generators, transform the outputs of generators, and convert
certain types of generators into Iterator
s.
The IntoGenerator
trait permits conversion of Iterator
s into
Generator
s. Due to the way built-in generator types are expressed by the
Rust compiler, the Gen
newtype wrapper is provided to allow
compiler-generated and external generator types to interoperate with
IntoGenerator
.
License
generator_extensions
is licensed under the terms of the
Apache License, Version 2.0 or the MIT License.
Development
generator_extensions
is developed at GitLab.
Modules
prelude | The generator_extensions prelude. |
Structs
Fuse | The return type of |
Gen | A newtype wrapper for built-in generators which provides an implementation
of the |
GenIter | An |
Iter | The return type of |
States | The return type of |
Unify | The return type of |
Enums
GeneratorState | Experimental The result of a generator resumption. |
Traits
Generator | Experimental The trait implemented by builtin generator types. |
IntoGenerator | This trait represents a value which can be transformed into a |
Resumable | This trait provides extension methods for generators behind references which allow resumption. |