#[must_use = "sinks do nothing unless polled"]
pub struct With<Si, U, Fut, F> where
Si: Sink,
F: FnMut(U) -> Fut,
Fut: Future, { /* fields omitted */ }
Sink for the Sink::with
combinator, chaining a computation to run prior
to pushing a value into the underlying sink.
Get a shared reference to the inner sink.
[−]
Get a mutable reference to the inner sink.
[−]
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.
impl<Si: Debug, U: Debug, Fut: Debug, F: Debug> Debug for With<Si, U, Fut, F> where Si: Sink, F: FnMut(U) -> Fut, Fut: Future, Si::SinkItem: Debug, | [src] |
[+]
[+]
type Item = S::Item
Values yielded by the stream.
[−]
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
impl<Si, U, Fut, F, E> Sink for With<Si, U, Fut, F> where Si: Sink, F: FnMut(U) -> Fut, Fut: Future<Output = Result<Si::SinkItem, E>>, E: From<Si::SinkError>, | [src] |
[+]
type SinkItem = U
The type of value that the sink accepts.
type SinkError = E
The type of value produced by the sink when an error occurs.
[−]
Attempts to prepare the Sink
to receive a value. Read more
[−]
Begin the process of sending a value to the sink. Each call to this function must be proceeded by a successful call to poll_ready
which returned Ok(Poll::Ready(()))
. Read more
[−]
Flush any remaining output from this sink. Read more
[−]
Flush any remaining output and close this sink, if necessary. Read more
impl<Si, U, Fut, F> Send for With<Si, U, Fut, F> where F: Send, Fut: Send, Si: Send, <Si as Sink>::SinkItem: Send, | |
impl<Si, U, Fut, F> Sync for With<Si, U, Fut, F> where F: Sync, Fut: Sync, Si: Sync, <Si as Sink>::SinkItem: Sync, | |