Struct futures_state_stream::Unfold
[−]
[src]
pub struct Unfold<T, F, Fut> where
Fut: IntoFuture, { /* fields omitted */ }
A stream which iteratively applies a closure to state to produce items.
Trait Implementations
impl<T, F, Fut, It, St, E> StateStream for Unfold<T, F, Fut> where
F: FnMut(T) -> Fut,
Fut: IntoFuture<Item = StreamEvent<(It, T), St>, Error = (E, St)>,
[src]
F: FnMut(T) -> Fut,
Fut: IntoFuture<Item = StreamEvent<(It, T), St>, Error = (E, St)>,
type Item = It
The items being streamed.
type State = St
The state returned when streaming completes.
type Error = E
The error returned.
fn poll(&mut self) -> Poll<StreamEvent<It, St>, (E, St)>
[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.