Crate stream_utils

source ·
Expand description

Extra Stream adaptors and functions.

To Extend [Stream] with methods in this crate, import the StreamUtils trait:

use stream_utils::StreamUtils;

Now, new methods like copied_multi_stream are available on all streams.

use futures_util::stream; // or futures::stream;
use stream_utils::StreamUtils;

let stream = stream::iter(0..3);
let streams = stream.copied_multi_stream(4);

Structs

Traits

Functions

  • Copies values from the inner stream into multiple new streams. Polls from inner stream one value and waits till all new streams have pulled a copied value. Note that not pulling from all new streams will result in a blocking state.