Struct futures::stream::Peekable[][src]

#[must_use = "streams do nothing unless polled"]
pub struct Peekable<St> where
    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> Peekable<St> where
    St: Stream
[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> Unpin for Peekable<St> where
    St: Unpin + Stream
[src]

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

Formats the value using the given formatter. Read more

impl<S> Stream for Peekable<S> where
    S: Stream
[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