Struct futures_util::stream::FilterMap
[−]
[src]
#[must_use = "streams do nothing unless polled"]pub struct FilterMap<S, R, F> where
S: Stream,
F: FnMut(S::Item) -> R,
R: IntoFuture<Error = S::Error>, { /* fields omitted */ }
A combinator used to filter the results of a stream and simultaneously map them to a different type.
This structure is returned by the Stream::filter_map
method.
Methods
impl<S, R, F> FilterMap<S, R, F> where
S: Stream,
F: FnMut(S::Item) -> R,
R: IntoFuture<Error = S::Error>,
[src]
S: Stream,
F: FnMut(S::Item) -> R,
R: IntoFuture<Error = S::Error>,
ⓘImportant traits for &'a mut Ipub fn get_ref(&self) -> &S
[src]
Acquires a reference to the underlying stream that this combinator is pulling from.
ⓘImportant traits for &'a mut Ipub fn get_mut(&mut self) -> &mut S
[src]
Acquires a mutable reference to the underlying stream that this combinator is pulling from.
Note that care must be taken to avoid tampering with the state of the stream which may otherwise confuse this combinator.
pub fn into_inner(self) -> S
[src]
Consumes this combinator, returning the underlying stream.
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: Debug, R: Debug, F: Debug> Debug for FilterMap<S, R, F> where
S: Stream,
F: FnMut(S::Item) -> R,
R: IntoFuture<Error = S::Error>,
R::Future: Debug,
[src]
S: Stream,
F: FnMut(S::Item) -> R,
R: IntoFuture<Error = S::Error>,
R::Future: Debug,
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<S, R, F> Sink for FilterMap<S, R, F> where
S: Stream + Sink,
F: FnMut(S::Item) -> R,
R: IntoFuture<Error = S::Error>,
[src]
S: Stream + Sink,
F: FnMut(S::Item) -> R,
R: IntoFuture<Error = S::Error>,
type SinkItem = S::SinkItem
The type of value that the sink accepts.
type SinkError = S::SinkError
The type of value produced by the sink when an error occurs.
fn poll_ready(&mut self, cx: &mut Context) -> Poll<(), Self::SinkError>
[src]
Attempts to prepare the Sink
to receive a value. Read more
fn start_send(&mut self, item: Self::SinkItem) -> Result<(), Self::SinkError>
[src]
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(Async::Ready(()))
. Read more
fn poll_flush(&mut self, cx: &mut Context) -> Poll<(), Self::SinkError>
[src]
Flush any remaining output from this sink. Read more
fn poll_close(&mut self, cx: &mut Context) -> Poll<(), Self::SinkError>
[src]
Flush any remaining output and close this sink, if necessary. Read more
impl<S, R, F, B> Stream for FilterMap<S, R, F> where
S: Stream,
F: FnMut(S::Item) -> R,
R: IntoFuture<Item = Option<B>, Error = S::Error>,
[src]
S: Stream,
F: FnMut(S::Item) -> R,
R: IntoFuture<Item = Option<B>, Error = S::Error>,
type Item = B
Values yielded by the stream.
type Error = S::Error
Errors yielded by the stream.
fn poll_next(&mut self, cx: &mut Context) -> Poll<Option<B>, S::Error>
[src]
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