Trait ex_futures::sink::SinkExt [] [src]

pub trait SinkExt: Sink {
    fn cloneable(self) -> Cloneable<Self>
    where
        Self: Sized
, { ... }
fn unsync_cloneable(self) -> UnsyncCloneable<Self>
    where
        Self: Sized
, { ... } }

An extension of Sink provided by futures crate. Any Sink implements SinkExt automatically. All you are needed to do is to import SinkExt.

use ex_futures::SinkExt;

Provided Methods

Convert any kind of sink into "cloneable" sink but unsync. That is kind like mpsc.

Examples

use ex_futures::SinkExt;

let (tx, rx) = ::futures::sync::mpsc::channel::<usize>(42);

let cloneable_sink = tx.unsync_cloneable(); // Convert "tx" into cloneable.
let cloneable_sink2 = cloneable_sink.clone(); // Now you can clone it.

Implementors