Struct futures_state_stream::FilterMap
[−]
[src]
pub struct FilterMap<S, F> { /* fields omitted */ }
A stream which applies a filter and transform to items of a stream.
Trait Implementations
impl<S, F, B> StateStream for FilterMap<S, F> where
S: StateStream,
F: FnMut(S::Item) -> Option<B>,
[src]
S: StateStream,
F: FnMut(S::Item) -> Option<B>,
type Item = B
The items being streamed.
type State = S::State
The state returned when streaming completes.
type Error = S::Error
The error returned.
fn poll(&mut self) -> Poll<StreamEvent<B, S::State>, (S::Error, S::State)>
[src]
Similar to Stream::poll
. Read more
fn into_future(self) -> IntoFuture<Self> where
Self: Sized,
[src]
Self: Sized,
Returns a future which yields the next element of the stream.
fn into_stream(self) -> IntoStream<Self> where
Self: Sized,
[src]
Self: Sized,
Returns a normal Stream
which yields the elements of this stream and discards the state.
fn map<F, B>(self, f: F) -> Map<Self, F> where
Self: Sized,
F: FnMut(Self::Item) -> B,
[src]
Self: Sized,
F: FnMut(Self::Item) -> B,
Returns a stream which applies a transform to items of this stream.
fn map_err<F, B>(self, f: F) -> MapErr<Self, F> where
Self: Sized,
F: FnMut(Self::Error) -> B,
[src]
Self: Sized,
F: FnMut(Self::Error) -> B,
Returns a stream which applies a transform to errors of this stream.
fn map_state<F, B>(self, f: F) -> MapState<Self, F> where
Self: Sized,
F: FnOnce(Self::State) -> B,
[src]
Self: Sized,
F: FnOnce(Self::State) -> B,
Returns a stream which applies a transform to the state of this stream.
fn filter<F>(self, f: F) -> Filter<Self, F> where
Self: Sized,
F: FnMut(&Self::Item) -> bool,
[src]
Self: Sized,
F: FnMut(&Self::Item) -> bool,
Returns a stream which filters items of this stream by a predicate.
fn filter_map<F, B>(self, f: F) -> FilterMap<Self, F> where
Self: Sized,
F: FnMut(Self::Item) -> Option<B>,
[src]
Self: Sized,
F: FnMut(Self::Item) -> Option<B>,
Returns a stream which filters and transforms items of this stream by a predicate.
fn collect(self) -> Collect<Self> where
Self: Sized,
[src]
Self: Sized,
Returns a stream which collects all items of this stream into a Vec
, returning it along with the stream's state. Read more
fn for_each<F>(self, f: F) -> ForEach<Self, F> where
Self: Sized,
F: FnMut(Self::Item),
[src]
Self: Sized,
F: FnMut(Self::Item),
Returns a future which applies a closure to each item of this stream.