Expand description

A crate for easily cloneable Streams, similar to FutureExt::shared.

Examples

use futures::stream::{self, StreamExt};
use shared_stream::Share;

let shared = stream::iter(1..=3).shared();
assert_eq!(shared.clone().take(1).collect::<Vec<_>>().await, [1]);
assert_eq!(shared.clone().skip(1).take(1).collect::<Vec<_>>().await, [2]);
assert_eq!(shared.collect::<Vec<_>>().await, [1, 2, 3]);

Structs

Stream for the shared method.

Traits

An extension trait implemented for Streams that provides the shared method.