pub async fn switch_stream<T, E1, E2>(
    strm: impl Stream<Item = T> + Unpin,
    pred: impl Fn(&T) -> bool,
    send_t: impl Sink<T, Error = E1> + Unpin,
    send_f: impl Sink<T, Error = E2> + Unpin
) -> Result<(), FatalErr>where
    E1: Into<FatalErr>,
    E2: Into<FatalErr>,
Expand description

Route values from an input stream to one of two output sinks according to a predicate