Trait futuristic::sink::SinkTools
source · [−]pub trait SinkTools<T>: Sink<T> {
fn fork<V, O, F, U>(self, other: O, switch: F) -> Fork<V, Self, O, F, T, U>
where
Self: Sized,
F: FnMut(V) -> Either<T, U>,
O: Sink<U, Error = Self::Error>,
{ ... }
}
Expand description
Extension trait for Sink
.
Provided Methods
sourcefn fork<V, O, F, U>(self, other: O, switch: F) -> Fork<V, Self, O, F, T, U>where
Self: Sized,
F: FnMut(V) -> Either<T, U>,
O: Sink<U, Error = Self::Error>,
fn fork<V, O, F, U>(self, other: O, switch: F) -> Fork<V, Self, O, F, T, U>where
Self: Sized,
F: FnMut(V) -> Either<T, U>,
O: Sink<U, Error = Self::Error>,
Returns a sink that dispatches to self
or other
.
Every item sent to the returned sink is passed to switch
and the returned value is sent
to one of the underlying sinks. Left
values are sent to self
while Right
values are
sent to other
.