Struct futures_util::sink::WithFlatMap [−][src]
#[must_use = "sinks do nothing unless polled"]pub struct WithFlatMap<Si, U, St, F> where
Si: Sink,
F: FnMut(U) -> St,
St: Stream<Item = Result<Si::SinkItem, Si::SinkError>>, { /* fields omitted */ }
Sink for the Sink::with_flat_map
combinator, chaining a computation that
returns an iterator to run prior to pushing a value into the underlying
sink.
Methods
impl<Si, U, St, F> WithFlatMap<Si, U, St, F> where
Si: Sink,
F: FnMut(U) -> St,
St: Stream<Item = Result<Si::SinkItem, Si::SinkError>>,
[src]
impl<Si, U, St, F> WithFlatMap<Si, U, St, F> where
Si: Sink,
F: FnMut(U) -> St,
St: Stream<Item = Result<Si::SinkItem, Si::SinkError>>,
ⓘImportant traits for &'a mut Wpub 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 Wpub 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 get_pin_mut<'a>(self: PinMut<'a, Self>) -> PinMut<'a, Si>
[src]
pub fn get_pin_mut<'a>(self: PinMut<'a, Self>) -> PinMut<'a, Si>
Get a pinned 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: Debug, U: Debug, St: Debug, F: Debug> Debug for WithFlatMap<Si, U, St, F> where
Si: Sink,
F: FnMut(U) -> St,
St: Stream<Item = Result<Si::SinkItem, Si::SinkError>>,
Si::SinkItem: Debug,
[src]
impl<Si: Debug, U: Debug, St: Debug, F: Debug> Debug for WithFlatMap<Si, U, St, F> where
Si: Sink,
F: FnMut(U) -> St,
St: Stream<Item = Result<Si::SinkItem, Si::SinkError>>,
Si::SinkItem: Debug,
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<Si, U, St, F> Unpin for WithFlatMap<Si, U, St, F> where
Si: Sink + Unpin,
F: FnMut(U) -> St,
St: Stream<Item = Result<Si::SinkItem, Si::SinkError>> + Unpin,
[src]
impl<Si, U, St, F> Unpin for WithFlatMap<Si, U, St, F> where
Si: Sink + Unpin,
F: FnMut(U) -> St,
St: Stream<Item = Result<Si::SinkItem, Si::SinkError>> + Unpin,
impl<S, U, St, F> Stream for WithFlatMap<S, U, St, F> where
S: Stream + Sink,
F: FnMut(U) -> St,
St: Stream<Item = Result<S::SinkItem, S::SinkError>>,
[src]
impl<S, U, St, F> Stream for WithFlatMap<S, U, St, F> where
S: Stream + Sink,
F: FnMut(U) -> St,
St: Stream<Item = Result<S::SinkItem, S::SinkError>>,
type Item = S::Item
Values yielded by the stream.
fn poll_next(self: PinMut<Self>, cx: &mut Context) -> Poll<Option<S::Item>>
[src]
fn poll_next(self: PinMut<Self>, cx: &mut Context) -> Poll<Option<S::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
impl<Si, U, St, F> Sink for WithFlatMap<Si, U, St, F> where
Si: Sink,
F: FnMut(U) -> St,
St: Stream<Item = Result<Si::SinkItem, Si::SinkError>>,
[src]
impl<Si, U, St, F> Sink for WithFlatMap<Si, U, St, F> where
Si: Sink,
F: FnMut(U) -> St,
St: Stream<Item = Result<Si::SinkItem, Si::SinkError>>,
type SinkItem = U
The type of value that the sink accepts.
type SinkError = Si::SinkError
The type of value produced by the sink when an error occurs.
fn poll_ready(
self: PinMut<Self>,
cx: &mut Context
) -> Poll<Result<(), Self::SinkError>>
[src]
fn poll_ready(
self: PinMut<Self>,
cx: &mut Context
) -> Poll<Result<(), Self::SinkError>>
Attempts to prepare the Sink
to receive a value. Read more
fn start_send(
self: PinMut<Self>,
item: Self::SinkItem
) -> Result<(), Self::SinkError>
[src]
fn start_send(
self: PinMut<Self>,
item: Self::SinkItem
) -> Result<(), Self::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<Self>,
cx: &mut Context
) -> Poll<Result<(), Self::SinkError>>
[src]
fn poll_flush(
self: PinMut<Self>,
cx: &mut Context
) -> Poll<Result<(), Self::SinkError>>
Flush any remaining output from this sink. Read more
fn poll_close(
self: PinMut<Self>,
cx: &mut Context
) -> Poll<Result<(), Self::SinkError>>
[src]
fn poll_close(
self: PinMut<Self>,
cx: &mut Context
) -> Poll<Result<(), Self::SinkError>>
Flush any remaining output and close this sink, if necessary. Read more