Struct futures::sink::With [−][src]
#[must_use = "sinks do nothing unless polled"]pub struct With<S, U, Fut, F> where
F: FnMut(U) -> Fut,
Fut: IntoFuture,
S: Sink, { /* fields omitted */ }
Sink for the Sink::with
combinator, chaining a computation to run prior
to pushing a value into the underlying sink.
Methods
impl<S, U, Fut, F> With<S, U, Fut, F> where
F: FnMut(U) -> Fut,
Fut: IntoFuture<Item = <S as Sink>::SinkItem>,
S: Sink,
<Fut as IntoFuture>::Error: From<<S as Sink>::SinkError>,
[src]
impl<S, U, Fut, F> With<S, U, Fut, F> where
F: FnMut(U) -> Fut,
Fut: IntoFuture<Item = <S as Sink>::SinkItem>,
S: Sink,
<Fut as IntoFuture>::Error: From<<S as Sink>::SinkError>,
ⓘImportant traits for &'a mut Ipub fn get_ref(&self) -> &S
[src]
pub fn get_ref(&self) -> &S
Get a shared reference to the inner sink.
ⓘImportant traits for &'a mut Ipub fn get_mut(&mut self) -> &mut S
[src]
pub fn get_mut(&mut self) -> &mut S
Get a mutable reference to the inner sink.
pub fn into_inner(self) -> S
[src]
pub fn into_inner(self) -> S
Consumes this combinator, returning the underlying sink.
Note that this may discard intermediate state of this combinator, so care should be taken to avoid losing resources when this is called.
Trait Implementations
impl<S, U, Fut, F> Debug for With<S, U, Fut, F> where
F: Debug + FnMut(U) -> Fut,
Fut: Debug + IntoFuture,
S: Debug + Sink,
U: Debug,
<Fut as IntoFuture>::Future: Debug,
<S as Sink>::SinkItem: Debug,
[src]
impl<S, U, Fut, F> Debug for With<S, U, Fut, F> where
F: Debug + FnMut(U) -> Fut,
Fut: Debug + IntoFuture,
S: Debug + Sink,
U: Debug,
<Fut as IntoFuture>::Future: Debug,
<S as Sink>::SinkItem: Debug,
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<S, U, Fut, F> Clone for With<S, U, Fut, F> where
F: Clone + FnMut(U) -> Fut,
Fut: Clone + IntoFuture,
S: Clone + Sink,
U: Clone,
<Fut as IntoFuture>::Future: Clone,
<S as Sink>::SinkItem: Clone,
[src]
impl<S, U, Fut, F> Clone for With<S, U, Fut, F> where
F: Clone + FnMut(U) -> Fut,
Fut: Clone + IntoFuture,
S: Clone + Sink,
U: Clone,
<Fut as IntoFuture>::Future: Clone,
<S as Sink>::SinkItem: Clone,
fn clone(&self) -> With<S, U, Fut, F>
[src]
fn clone(&self) -> With<S, U, Fut, F>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<S, U, Fut, F> Sink for With<S, U, Fut, F> where
F: FnMut(U) -> Fut,
Fut: IntoFuture<Item = <S as Sink>::SinkItem>,
S: Sink,
<Fut as IntoFuture>::Error: From<<S as Sink>::SinkError>,
[src]
impl<S, U, Fut, F> Sink for With<S, U, Fut, F> where
F: FnMut(U) -> Fut,
Fut: IntoFuture<Item = <S as Sink>::SinkItem>,
S: Sink,
<Fut as IntoFuture>::Error: From<<S as Sink>::SinkError>,
type SinkItem = U
The type of value that the sink accepts.
type SinkError = <Fut as IntoFuture>::Error
The type of value produced by the sink when an error occurs.
fn poll_ready(
&mut self,
cx: &mut Context
) -> Result<Async<()>, <With<S, U, Fut, F> as Sink>::SinkError>
[src]
fn poll_ready(
&mut self,
cx: &mut Context
) -> Result<Async<()>, <With<S, U, Fut, F> as Sink>::SinkError>
Attempts to prepare the Sink
to receive a value. Read more
fn start_send(
&mut self,
item: <With<S, U, Fut, F> as Sink>::SinkItem
) -> Result<(), <With<S, U, Fut, F> as Sink>::SinkError>
[src]
fn start_send(
&mut self,
item: <With<S, U, Fut, F> as Sink>::SinkItem
) -> Result<(), <With<S, U, Fut, F> as Sink>::SinkError>
Begin the process of sending a value to the sink. Each call to this function must be preceded by a successful call to poll_ready
which returned Ok(Async::Ready(()))
. Read more
fn poll_flush(
&mut self,
cx: &mut Context
) -> Result<Async<()>, <With<S, U, Fut, F> as Sink>::SinkError>
[src]
fn poll_flush(
&mut self,
cx: &mut Context
) -> Result<Async<()>, <With<S, U, Fut, F> as Sink>::SinkError>
Flush any remaining output from this sink. Read more
fn poll_close(
&mut self,
cx: &mut Context
) -> Result<Async<()>, <With<S, U, Fut, F> as Sink>::SinkError>
[src]
fn poll_close(
&mut self,
cx: &mut Context
) -> Result<Async<()>, <With<S, U, Fut, F> as Sink>::SinkError>
Flush any remaining output and close this sink, if necessary. Read more
impl<S, U, Fut, F> Stream for With<S, U, Fut, F> where
F: FnMut(U) -> Fut,
Fut: IntoFuture,
S: Stream + Sink,
[src]
impl<S, U, Fut, F> Stream for With<S, U, Fut, F> where
F: FnMut(U) -> Fut,
Fut: IntoFuture,
S: Stream + Sink,
type Item = <S as Stream>::Item
Values yielded by the stream.
type Error = <S as Stream>::Error
Errors yielded by the stream.
fn poll_next(
&mut self,
cx: &mut Context
) -> Result<Async<Option<<S as Stream>::Item>>, <S as Stream>::Error>
[src]
fn poll_next(
&mut self,
cx: &mut Context
) -> Result<Async<Option<<S as Stream>::Item>>, <S as Stream>::Error>
Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None
if the stream is exhausted. Read more