[][src]Trait futuristic::sink::SinkTools

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>
, { ... } }

Extension trait for Sink.

Provided methods

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.

Loading content...

Implementors

impl<T, S: Sink<T>> SinkTools<T> for S[src]

Loading content...