Struct futures_util::stream::Peekable[][src]

#[must_use = "streams do nothing unless polled"]
pub struct Peekable<St: Stream> { /* fields omitted */ }

A Stream that implements a peek method.

The peek method can be used to retrieve a reference to the next Stream::Item if available. A subsequent call to poll will return the owned item.

Methods

impl<St: Stream> Peekable<St>
[src]

Peek retrieves a reference to the next item in the stream.

This method polls the underlying stream and return either a reference to the next item if the stream is ready or passes through any errors.

Trait Implementations

impl<St: Debug + Stream> Debug for Peekable<St> where
    St::Item: Debug
[src]

Formats the value using the given formatter. Read more

impl<St: Stream + Unpin> Unpin for Peekable<St>
[src]

impl<S: Stream> Stream for Peekable<S>
[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> Send for Peekable<St> where
    St: Send,
    <St as Stream>::Item: Send

impl<St> Sync for Peekable<St> where
    St: Sync,
    <St as Stream>::Item: Sync