Struct futures::sink::With [−][src]
#[must_use = "sinks do nothing unless polled"]pub struct With<Si, U, Fut, F> where
F: FnMut(U) -> Fut,
Fut: Future,
Si: 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<Si, U, Fut, F, E> With<Si, U, Fut, F> where
E: From<<Si as Sink>::SinkError>,
F: FnMut(U) -> Fut,
Fut: Future<Output = Result<<Si as Sink>::SinkItem, E>>,
Si: Sink,
[src]
impl<Si, U, Fut, F, E> With<Si, U, Fut, F> where
E: From<<Si as Sink>::SinkError>,
F: FnMut(U) -> Fut,
Fut: Future<Output = Result<<Si as Sink>::SinkItem, E>>,
Si: Sink,
ⓘImportant traits for &'a mut Ipub fn get_ref(&self) -> &Si
[src]
pub fn get_ref(&self) -> &Si
Get a shared reference to the inner sink.
ⓘImportant traits for &'a mut Ipub fn get_mut(&mut self) -> &mut Si
[src]
pub fn get_mut(&mut self) -> &mut Si
Get a mutable reference to the inner sink.
pub fn into_inner(self) -> Si
[src]
pub fn into_inner(self) -> Si
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<Si, U, Fut, F, E> Sink for With<Si, U, Fut, F> where
E: From<<Si as Sink>::SinkError>,
F: FnMut(U) -> Fut,
Fut: Future<Output = Result<<Si as Sink>::SinkItem, E>>,
Si: Sink,
[src]
impl<Si, U, Fut, F, E> Sink for With<Si, U, Fut, F> where
E: From<<Si as Sink>::SinkError>,
F: FnMut(U) -> Fut,
Fut: Future<Output = Result<<Si as Sink>::SinkItem, E>>,
Si: Sink,
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.
fn poll_ready(
self: PinMut<With<Si, U, Fut, F>>,
cx: &mut Context
) -> Poll<Result<(), <With<Si, U, Fut, F> as Sink>::SinkError>>
[src]
fn poll_ready(
self: PinMut<With<Si, U, Fut, F>>,
cx: &mut Context
) -> Poll<Result<(), <With<Si, U, Fut, F> as Sink>::SinkError>>
Attempts to prepare the Sink
to receive a value. Read more
fn start_send(
self: PinMut<With<Si, U, Fut, F>>,
item: <With<Si, U, Fut, F> as Sink>::SinkItem
) -> Result<(), <With<Si, U, Fut, F> as Sink>::SinkError>
[src]
fn start_send(
self: PinMut<With<Si, U, Fut, F>>,
item: <With<Si, U, Fut, F> as Sink>::SinkItem
) -> Result<(), <With<Si, U, Fut, F> as Sink>::SinkError>
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
fn poll_flush(
self: PinMut<With<Si, U, Fut, F>>,
cx: &mut Context
) -> Poll<Result<(), <With<Si, U, Fut, F> as Sink>::SinkError>>
[src]
fn poll_flush(
self: PinMut<With<Si, U, Fut, F>>,
cx: &mut Context
) -> Poll<Result<(), <With<Si, U, Fut, F> as Sink>::SinkError>>
Flush any remaining output from this sink. Read more
fn poll_close(
self: PinMut<With<Si, U, Fut, F>>,
cx: &mut Context
) -> Poll<Result<(), <With<Si, U, Fut, F> as Sink>::SinkError>>
[src]
fn poll_close(
self: PinMut<With<Si, U, Fut, F>>,
cx: &mut Context
) -> Poll<Result<(), <With<Si, U, Fut, F> as Sink>::SinkError>>
Flush any remaining output and close this sink, if necessary. Read more
impl<Si, U, Fut, F> Unpin for With<Si, U, Fut, F> where
F: FnMut(U) -> Fut,
Fut: Future + Unpin,
Si: Sink + Unpin,
[src]
impl<Si, U, Fut, F> Unpin for With<Si, U, Fut, F> where
F: FnMut(U) -> Fut,
Fut: Future + Unpin,
Si: Sink + Unpin,
impl<Si, U, Fut, F> Debug for With<Si, U, Fut, F> where
F: Debug + FnMut(U) -> Fut,
Fut: Debug + Future,
Si: Debug + Sink,
U: Debug,
<Si as Sink>::SinkItem: Debug,
[src]
impl<Si, U, Fut, F> Debug for With<Si, U, Fut, F> where
F: Debug + FnMut(U) -> Fut,
Fut: Debug + Future,
Si: Debug + Sink,
U: Debug,
<Si 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> Stream for With<S, U, Fut, F> where
F: FnMut(U) -> Fut,
Fut: Future,
S: Stream + Sink,
[src]
impl<S, U, Fut, F> Stream for With<S, U, Fut, F> where
F: FnMut(U) -> Fut,
Fut: Future,
S: Stream + Sink,
type Item = <S as Stream>::Item
Values yielded by the stream.
fn poll_next(
self: PinMut<With<S, U, Fut, F>>,
cx: &mut Context
) -> Poll<Option<<S as Stream>::Item>>
[src]
fn poll_next(
self: PinMut<With<S, U, Fut, F>>,
cx: &mut Context
) -> Poll<Option<<S as Stream>::Item>>
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