pub struct Fanout<A, B>{ /* private fields */ }
Expand description
Sink that clones incoming items and forwards them to two sinks at the same time.
Backpressure from any downstream sink propagates up, which means that this sink can only process items as fast as its slowest downstream sink.
Implementations§
Trait Implementations§
Source§impl<A, B> Sink for Fanout<A, B>
impl<A, B> Sink for Fanout<A, B>
Source§type SinkError = <A as Sink>::SinkError
type SinkError = <A as Sink>::SinkError
The type of value produced by the sink when an error occurs.
Source§fn start_send(
&mut self,
item: <Fanout<A, B> as Sink>::SinkItem,
) -> Result<AsyncSink<<Fanout<A, B> as Sink>::SinkItem>, <Fanout<A, B> as Sink>::SinkError>
fn start_send( &mut self, item: <Fanout<A, B> as Sink>::SinkItem, ) -> Result<AsyncSink<<Fanout<A, B> as Sink>::SinkItem>, <Fanout<A, B> as Sink>::SinkError>
Begin the process of sending a value to the sink. Read more
Source§fn poll_complete(
&mut self,
) -> Result<Async<()>, <Fanout<A, B> as Sink>::SinkError>
fn poll_complete( &mut self, ) -> Result<Async<()>, <Fanout<A, B> as Sink>::SinkError>
Flush all output from this sink, if necessary. Read more
Source§fn close(&mut self) -> Result<Async<()>, <Fanout<A, B> as Sink>::SinkError>
fn close(&mut self) -> Result<Async<()>, <Fanout<A, B> as Sink>::SinkError>
A method to indicate that no more values will ever be pushed into this
sink. Read more
Source§fn wait(self) -> Wait<Self>where
Self: Sized,
fn wait(self) -> Wait<Self>where
Self: Sized,
Creates a new object which will produce a synchronous sink. Read more
Source§fn with<U, F, Fut>(self, f: F) -> With<Self, U, F, Fut>where
F: FnMut(U) -> Fut,
Fut: IntoFuture<Item = Self::SinkItem>,
<Fut as IntoFuture>::Error: From<Self::SinkError>,
Self: Sized,
fn with<U, F, Fut>(self, f: F) -> With<Self, U, F, Fut>where
F: FnMut(U) -> Fut,
Fut: IntoFuture<Item = Self::SinkItem>,
<Fut as IntoFuture>::Error: From<Self::SinkError>,
Self: Sized,
Composes a function in front of the sink. Read more
Source§fn with_flat_map<U, F, St>(self, f: F) -> WithFlatMap<Self, U, F, St>
fn with_flat_map<U, F, St>(self, f: F) -> WithFlatMap<Self, U, F, St>
Composes a function in front of the sink. Read more
Source§fn sink_map_err<F, E>(self, f: F) -> SinkMapErr<Self, F>
fn sink_map_err<F, E>(self, f: F) -> SinkMapErr<Self, F>
Transforms the error returned by the sink.
Source§fn sink_from_err<E>(self) -> SinkFromErr<Self, E>
fn sink_from_err<E>(self) -> SinkFromErr<Self, E>
Map this sink’s error to any error implementing
From
for this sink’s
Error
, returning a new sink. Read moreSource§fn buffer(self, amt: usize) -> Buffer<Self>where
Self: Sized,
fn buffer(self, amt: usize) -> Buffer<Self>where
Self: Sized,
Adds a fixed-size buffer to the current sink. Read more
Source§fn flush(self) -> Flush<Self>where
Self: Sized,
fn flush(self) -> Flush<Self>where
Self: Sized,
A future that completes when the sink has finished processing all
pending requests. Read more
Auto Trait Implementations§
impl<A, B> Freeze for Fanout<A, B>
impl<A, B> RefUnwindSafe for Fanout<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
<A as Sink>::SinkItem: RefUnwindSafe,
<B as Sink>::SinkItem: RefUnwindSafe,
impl<A, B> Send for Fanout<A, B>
impl<A, B> Sync for Fanout<A, B>
impl<A, B> Unpin for Fanout<A, B>
impl<A, B> UnwindSafe for Fanout<A, B>where
A: UnwindSafe,
B: UnwindSafe,
<A as Sink>::SinkItem: UnwindSafe,
<B as Sink>::SinkItem: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more