Struct futures_state_stream::FromStream
[−]
[src]
pub struct FromStream<S>(_);
A StateStream
yielding elements of a normal `Stream.
Trait Implementations
impl<S> StateStream for FromStream<S> where
S: Stream,
[src]
S: Stream,
type Item = S::Item
The items being streamed.
type State = ()
The state returned when streaming completes.
type Error = S::Error
The error returned.
fn poll(&mut self) -> Poll<StreamEvent<S::Item, ()>, S::Error>
Similar to Stream::poll
. Read more
fn boxed(self) -> BoxStateStream<Self::Item, Self::State, Self::Error> where
Self: Sized + Send + 'static,
Self: Sized + Send + 'static,
Returns this stream as a boxed trait object.
fn into_future(self) -> IntoFuture<Self> where
Self: Sized,
Self: Sized,
Returns a future which yields the next element of the stream.
fn into_stream(self) -> IntoStream<Self> where
Self: Sized,
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,
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,
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,
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,
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>,
Self: Sized,
F: FnMut(Self::Item) -> Option<B>,
Returns a stream which filters and transforms items of this stream by a predicate.
fn then<F, U>(self, f: F) -> Then<Self, F, U> where
Self: Sized,
F: FnMut(Result<Self::Item, Self::Error>) -> U,
U: IntoFuture,
Self::Error: From<U::Error>,
Self: Sized,
F: FnMut(Result<Self::Item, Self::Error>) -> U,
U: IntoFuture,
Self::Error: From<U::Error>,
Returns a stream which transforms results of this stream into a new future.
fn and_then<F, U>(self, f: F) -> AndThen<Self, F, U> where
Self: Sized,
F: FnMut(Self::Item) -> U,
U: IntoFuture,
Self::Error: From<U::Error>,
Self: Sized,
F: FnMut(Self::Item) -> U,
U: IntoFuture,
Self::Error: From<U::Error>,
Returns a stream which transforms items of this stream into a new future.
fn and_then_state<F, U>(self, f: F) -> AndThenState<Self, F, U> where
Self: Sized,
F: FnMut(Self::State) -> U,
U: IntoFuture,
Self::Error: From<U::Error>,
Self: Sized,
F: FnMut(Self::State) -> U,
U: IntoFuture,
Self::Error: From<U::Error>,
Returns a stream which transforms the state of this stream into a new future.
fn or_else<F, U>(self, f: F) -> OrElse<Self, F, U> where
Self: Sized,
F: FnMut(Self::Error) -> U,
U: IntoFuture<Item = Self::Item>,
Self: Sized,
F: FnMut(Self::Error) -> U,
U: IntoFuture<Item = Self::Item>,
Returns a stream which transforms errors of this stream into a new future.
fn collect(self) -> Collect<Self> where
Self: Sized,
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 fold<T, F, Fut, G, Fut2>(
self,
init: T,
next: F,
done: G
) -> Fold<Self, T, F, Fut, G, Fut2> where
Self: Sized,
F: FnMut(T, Self::Item) -> Fut,
Fut: IntoFuture<Item = T>,
Self::Error: From<Fut::Error>,
G: FnOnce(T, Self::State) -> Fut2,
Fut2: IntoFuture<Item = T>,
Self::Error: From<Fut2::Error>,
self,
init: T,
next: F,
done: G
) -> Fold<Self, T, F, Fut, G, Fut2> where
Self: Sized,
F: FnMut(T, Self::Item) -> Fut,
Fut: IntoFuture<Item = T>,
Self::Error: From<Fut::Error>,
G: FnOnce(T, Self::State) -> Fut2,
Fut2: IntoFuture<Item = T>,
Self::Error: From<Fut2::Error>,
Applies a fold across all elements of this stream and its state.
fn skip_while<P, R>(self, pred: P) -> SkipWhile<Self, P, R> where
Self: Sized,
P: FnMut(&Self::Item) -> R,
R: IntoFuture<Item = bool, Error = Self::Error>,
Self: Sized,
P: FnMut(&Self::Item) -> R,
R: IntoFuture<Item = bool, Error = Self::Error>,
Returns a stream which skips initial elements matching a predicate.
fn for_each<F>(self, f: F) -> ForEach<Self, F> where
Self: Sized,
F: FnMut(Self::Item) -> Result<(), Self::Error>,
Self: Sized,
F: FnMut(Self::Item) -> Result<(), Self::Error>,
Returns a future which applies a closure to each item of this stream.
fn catch_unwind(self) -> CatchUnwind<Self> where
Self: Sized + UnwindSafe,
Self: Sized + UnwindSafe,
Returns a future which catches panics generated by this stream.
fn buffered(self, amt: usize) -> Buffered<Self> where
Self: Sized,
Self::Item: IntoFuture<Error = Self::Error>,
Self: Sized,
Self::Item: IntoFuture<Error = Self::Error>,
Returns a stream which buffers a fixed number of items of this stream.
fn buffered_unordered(self, amt: usize) -> BufferedUnordered<Self> where
Self: Sized,
Self::Item: IntoFuture<Error = Self::Error>,
Self: Sized,
Self::Item: IntoFuture<Error = Self::Error>,
Returns a stream which buffers a fixed number of items of this stream, returning them out of order as they become ready. Read more