Trait futures_state_stream::StateStream [] [src]

pub trait StateStream {
    type Item;
    type State;
    type Error;
    fn poll(
        &mut self
    ) -> Poll<StreamEvent<Self::Item, Self::State>, Self::Error>; fn boxed(self) -> BoxStateStream<Self::Item, Self::State, Self::Error>
    where
        Self: Sized + Send + 'static
, { ... } fn into_future(self) -> IntoFuture<Self>
    where
        Self: Sized
, { ... } fn into_stream(self) -> IntoStream<Self>
    where
        Self: Sized
, { ... } fn map<F, B>(self, f: F) -> Map<Self, F>
    where
        Self: Sized,
        F: FnMut(Self::Item) -> B
, { ... } fn map_err<F, B>(self, f: F) -> MapErr<Self, F>
    where
        Self: Sized,
        F: FnMut(Self::Error) -> B
, { ... } fn map_state<F, B>(self, f: F) -> MapState<Self, F>
    where
        Self: Sized,
        F: FnOnce(Self::State) -> B
, { ... } fn filter<F>(self, f: F) -> Filter<Self, F>
    where
        Self: Sized,
        F: FnMut(&Self::Item) -> bool
, { ... } fn filter_map<F, B>(self, f: F) -> FilterMap<Self, F>
    where
        Self: Sized,
        F: FnMut(Self::Item) -> Option<B>
, { ... } 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>
, { ... } 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>
, { ... } 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>
, { ... } 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>
, { ... } fn collect(self) -> Collect<Self>
    where
        Self: Sized
, { ... } 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>
, { ... } 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>
, { ... } fn for_each<F>(self, f: F) -> ForEach<Self, F>
    where
        Self: Sized,
        F: FnMut(Self::Item) -> Result<(), Self::Error>
, { ... } fn catch_unwind(self) -> CatchUnwind<Self>
    where
        Self: Sized + UnwindSafe
, { ... } fn buffered(self, amt: usize) -> Buffered<Self>
    where
        Self: Sized,
        Self::Item: IntoFuture<Error = Self::Error>
, { ... } fn buffered_unordered(self, amt: usize) -> BufferedUnordered<Self>
    where
        Self: Sized,
        Self::Item: IntoFuture<Error = Self::Error>
, { ... } }

A variant of futures::Stream which returns a state value when it completes.

Associated Types

The items being streamed.

The state returned when streaming completes.

The error returned.

Required Methods

Similar to Stream::poll.

The end of a stream is indicated by a StreamEvent::Done value. The result of calling poll after the end of the stream or an error has been reached is unspecified.

Provided Methods

Returns this stream as a boxed trait object.

Returns a future which yields the next element of the stream.

Returns a normal Stream which yields the elements of this stream and discards the state.

Returns a stream which applies a transform to items of this stream.

Returns a stream which applies a transform to errors of this stream.

Returns a stream which applies a transform to the state of this stream.

Returns a stream which filters items of this stream by a predicate.

Returns a stream which filters and transforms items of this stream by a predicate.

Returns a stream which transforms results of this stream into a new future.

Returns a stream which transforms items of this stream into a new future.

Returns a stream which transforms the state of this stream into a new future.

Returns a stream which transforms errors of this stream into a new future.

Returns a stream which collects all items of this stream into a Vec, returning it along with the stream's state.

Applies a fold across all elements of this stream and its state.

Returns a stream which skips initial elements matching a predicate.

Returns a future which applies a closure to each item of this stream.

Returns a future which catches panics generated by this stream.

Returns a stream which buffers a fixed number of items of this stream.

Returns a stream which buffers a fixed number of items of this stream, returning them out of order as they become ready.

Implementors