Crate clone_stream

Crate clone_stream 

Source
Expand description

§Clone streams with clone-stream

Turn any Stream into a cloneable stream where each clone receives all items independently.

The CloneStream struct implements Clone + Stream, allowing you to create multiple independent consumers of the same data. The ForkStream trait provides the entry point for converting regular streams.

§Quick Start

use clone_stream::ForkStream;
use futures::{StreamExt, stream};

let stream = stream::iter(vec![1, 2, 3]).fork();
let mut clone1 = stream.clone();
let mut clone2 = stream.clone();
// Both clones receive all items independently

Structs§

CloneStream
A stream that implements Clone and returns cloned items from a base stream.
ForkConfig
Configuration for Fork behavior.

Enums§

CloneStreamError
Errors that can occur when working with cloned streams

Traits§

ForkStream
Extension trait to make any Stream cloneable.

Type Aliases§

Result
Result type for clone stream operations