Function repeat_with
fn repeat_with<A, F: FnMut() -> A>(repeater: F) -> RepeatWith<F>
Creates a new stream that repeats elements of type A endlessly by
applying the provided closure, the repeater, F: FnMut() -> A.
The repeat_with() function calls the repeater over and over again.
Infinite stream like repeat_with() are often used with adapters like
[stream.take()], in order to make them finite.
If the element type of the stream you need implements Clone, and
it is OK to keep the source element in memory, you should instead use
the [stream.repeat()] function.
Examples
Basic usage:
# block_on;
Using mutation and going finite:
# block_on;