Function flo_stream::switchable_stream [−][src]
pub fn switchable_stream<TStream: 'static + Send + Stream>(
stream: TStream
) -> (SwitchingStream<TStream::Item>, StreamSwitch<TStream::Item>)
Expand description
Returns a switching stream and its switch, set to initially read from the stream that’s passed in
A switching stream can be changed to return results from another stream at any time. It’s quite useful for things like streams of events in particular, where something like a user interface might want to change the source of events around.
The StreamSwitch
can be used to change where the results for the returned SwitchingStream
are generated from. The
SwitchingStream
will only close once both its underlying stream has finished and the switch has been dropped.