split

Function split 

Source
pub fn split<S, SinkItem>(
    stream_sink: S,
) -> (SplitSink<S, SinkItem>, SplitStream<S>)
where S: Stream + Sized + Sink<SinkItem>,
Expand description

Splits a Stream + Sink object into separate Sink and Stream objects.

This can be useful when you want to split ownership between tasks, or allow direct interaction between the two objects (e.g. via Sink::send_all).