pub fn generate<'a, I, R, C, F>(cb: C) -> Generator<F, I, R>
Expand description
Produces an asynchronous Stream
of GeneratorState<I, R>
by invoking the given closure
with a handle that can be used to yield items.
The returned Stream
will produce a GeneratorState::Yielded variant for all yielded items
from the asynchronous task, followed by a single GeneratorState::Complete variant, which will
always be present as the final element in the stream.