[][src]Struct futures_util::stream::TakeWhile

#[must_use = "streams do nothing unless polled"]
pub struct TakeWhile<St: Stream, Fut, F> { /* 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<St, Fut, F> TakeWhile<St, Fut, F> where
    St: Stream,
    F: FnMut(&St::Item) -> Fut,
    Fut: Future<Output = bool>, 
[src]

Important traits for &'a mut W

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

Important traits for &'a mut W

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<St: Debug + Stream, Fut: Debug, F: Debug> Debug for TakeWhile<St, Fut, F> where
    St::Item: Debug
[src]

Formats the value using the given formatter. Read more

impl<St: Unpin + Stream, Fut: Unpin, F> Unpin for TakeWhile<St, Fut, F>
[src]

impl<St, Fut, F> Stream for TakeWhile<St, Fut, F> where
    St: Stream,
    F: FnMut(&St::Item) -> Fut,
    Fut: Future<Output = bool>, 
[src]

Values 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<St, Fut, F> Send for TakeWhile<St, Fut, F> where
    F: Send,
    Fut: Send,
    St: Send,
    <St as Stream>::Item: Send

impl<St, Fut, F> Sync for TakeWhile<St, Fut, F> where
    F: Sync,
    Fut: Sync,
    St: Sync,
    <St as Stream>::Item: Sync