[][src]Struct futures::stream::TakeWhile

#[must_use = "streams do nothing unless polled"]
pub struct TakeWhile<S, R, P> where
    R: IntoFuture,
    S: Stream
{ /* fields omitted */ }

A stream combinator which takes elements from a stream while a predicate holds.

This structure is produced by the Stream::take_while method.

Methods

impl<S, R, P> TakeWhile<S, R, P> where
    R: IntoFuture,
    S: Stream
[src]

Acquires a reference to the underlying stream that this combinator is pulling from.

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.

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, R, P> Sink for TakeWhile<S, R, P> where
    R: IntoFuture,
    S: Sink + Stream
[src]

The type of value that the sink accepts.

The type of value produced by the sink when an error occurs.

Attempts to prepare the Sink to receive a value. Read more

Begin the process of sending a value to the sink. Each call to this function must be preceded by a successful call to poll_ready which returned Ok(Async::Ready(())). Read more

Flush any remaining output from this sink. Read more

Flush any remaining output and close this sink, if necessary. Read more

impl<S, R, P> Debug for TakeWhile<S, R, P> where
    P: Debug,
    R: Debug + IntoFuture,
    S: Debug + Stream,
    <R as IntoFuture>::Future: Debug,
    <S as Stream>::Item: Debug
[src]

Formats the value using the given formatter. Read more

impl<S, R, P> Stream for TakeWhile<S, R, P> where
    P: FnMut(&<S as Stream>::Item) -> R,
    R: IntoFuture<Item = bool, Error = <S as Stream>::Error>,
    S: Stream
[src]

Values yielded by the stream.

Errors yielded by the stream.

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

Auto Trait Implementations

impl<S, R, P> Send for TakeWhile<S, R, P> where
    P: Send,
    S: Send,
    <R as IntoFuture>::Future: Send,
    <S as Stream>::Item: Send

impl<S, R, P> Sync for TakeWhile<S, R, P> where
    P: Sync,
    S: Sync,
    <R as IntoFuture>::Future: Sync,
    <S as Stream>::Item: Sync

Blanket Implementations

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]

Converts this stream into a Future. Read more

Converts a stream of type T to a stream of type U. Read more

Converts a stream of error type T to a stream of error type U. Read more

Filters the values produced by this stream according to the provided predicate. Read more

Filters the values produced by this stream while simultaneously mapping them to a different type. Read more

Chain on a computation for when a value is ready, passing the resulting item to the provided closure f. Read more

Chain on a computation for when a value is ready, passing the successful results to the provided closure f. Read more

Chain on a computation for when an error happens, passing the erroneous result to the provided closure f. Read more

Collect all of the values of this stream into a vector, returning a future representing the result of that computation. Read more

Concatenate all results of a stream into a single extendable destination, returning a future representing the end result. Read more

Execute an accumulating computation over a stream, collecting all the values into one final result. Read more

Flattens a stream of streams into just one continuous stream. Read more

Skip elements on this stream while the predicate provided resolves to true. Read more

Take elements from this stream while the predicate provided resolves to true. Read more

Runs this stream to completion, executing the provided closure for each element on the stream. Read more

Runs this stream to completion, executing the provided closure for each element on the stream. This is similar to for_each but may begin processing an element while previous elements are still being processed. Read more

Map this stream's error to a different type using the Into trait. Read more

Creates a new stream of at most amt items of the underlying stream. Read more

Creates a new stream which skips amt items of the underlying stream. Read more

Fuse a stream such that poll will never again be called once it has finished. Read more

Borrows a stream, rather than consuming it. Read more

Catches unwinding panics while polling the stream. Read more

An adaptor for creating a buffered list of pending futures. Read more

An adaptor for creating a buffered list of pending futures (unordered). Read more

An adapter for zipping two streams together. Read more

Adapter for chaining two stream. Read more

Creates a new stream which exposes a peek method. Read more

An adaptor for chunking up items of the stream inside a vector. Read more

Creates a stream that selects the next element from either this stream or the provided one, whichever is ready first. Read more

A future that completes after the given stream has been fully processed into the sink, including flushing. Read more

Splits this Stream + Sink object into separate Stream and Sink objects. Read more

Do something with each item of this stream, afterwards passing it on. Read more

Do something with the error of this stream, afterwards passing it on. Read more

Handle errors generated by this stream by converting them into Option<Self::Item>, such that a None value terminates the stream. Read more

Important traits for Either<L, R>

Deprecated

: use left_stream instead

Wrap this stream in an Either stream, making it the left-hand variant of that Either. Read more

Important traits for Either<L, R>

Deprecated

: use right_stream instead

Wrap this stream in an Either stream, making it the right-hand variant of that Either. Read more

Important traits for Either<L, R>

Wrap this stream in an Either stream, making it the left-hand variant of that Either. Read more

Important traits for Either<L, R>

Wrap this stream in an Either stream, making it the right-hand variant of that Either. Read more

impl<T> SinkExt for T where
    T: Sink + ?Sized
[src]

Composes a function in front of the sink. Read more

Composes a function in front of the sink. Read more

Transforms the error returned by the sink.

Map this sink's error to a different error type using the Into trait. Read more

Adds a fixed-size buffer to the current sink. Read more

Close the sink. Read more

Fanout items to multiple sinks. Read more

Flush the sync, processing all pending items. Read more

A future that completes after the given item has been fully processed into the sink, including flushing. Read more

A future that completes after the given stream has been fully processed into the sink, including flushing. Read more

Important traits for Either<L, R>

Wrap this sink in an Either sink, making it the left-hand variant of that Either. Read more

Important traits for Either<L, R>

Wrap this stream in an Either stream, making it the right-hand variant of that Either. Read more