Trait Share

Source
pub trait Share: Stream {
    // Required method
    fn shared(self) -> Shared<Self>
       where Self: Sized,
             Self::Item: Clone;
}
Expand description

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

Required Methods§

Source

fn shared(self) -> Shared<Self>
where Self: Sized, Self::Item: Clone,

Turns this stream into a cloneable stream. Polled items are cached and cloned.

Note that this function consumes the stream passed into it and returns a wrapped version of it.

Implementors§

Source§

impl<T: Stream> Share for T
where T::Item: Clone,