Struct futures::stream::Peekable [−][src]
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]
[−]
impl<St> Peekable<St> where
St: Stream,
pub fn peek(
self: &'a mut PinMut<Peekable<St>>,
cx: &mut Context
) -> Poll<Option<&'a <St as Stream>::Item>>
[src]
[−]
pub fn peek(
self: &'a mut PinMut<Peekable<St>>,
cx: &mut Context
) -> Poll<Option<&'a <St as Stream>::Item>>
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> Unpin for Peekable<St> where
St: Unpin + Stream,
impl<St> Debug for Peekable<St> where
St: Debug + Stream,
<St as Stream>::Item: Debug,
[src]
[+]
impl<St> Debug for Peekable<St> where
St: Debug + Stream,
<St as Stream>::Item: Debug,
impl<S> Stream for Peekable<S> where
S: Stream,
[src]
[+]
impl<S> Stream for Peekable<S> where
S: Stream,