Struct futures_util::stream::StreamFuture
source · [−]pub struct StreamFuture<St> { /* private fields */ }
Expand description
Future for the into_future
method.
Implementations
sourceimpl<St: Stream + Unpin> StreamFuture<St>
impl<St: Stream + Unpin> StreamFuture<St>
sourcepub fn get_ref(&self) -> Option<&St>
pub fn get_ref(&self) -> Option<&St>
Acquires a reference to the underlying stream that this combinator is pulling from.
This method returns an Option
to account for the fact that StreamFuture
’s
implementation of Future::poll
consumes the underlying stream during polling
in order to return it to the caller of Future::poll
if the stream yielded
an element.
sourcepub fn get_mut(&mut self) -> Option<&mut St>
pub fn get_mut(&mut self) -> Option<&mut St>
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.
This method returns an Option
to account for the fact that StreamFuture
’s
implementation of Future::poll
consumes the underlying stream during polling
in order to return it to the caller of Future::poll
if the stream yielded
an element.
sourcepub fn get_pin_mut(self: Pin<&mut Self>) -> Option<Pin<&mut St>>
pub fn get_pin_mut(self: Pin<&mut Self>) -> Option<Pin<&mut St>>
Acquires a pinned 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.
This method returns an Option
to account for the fact that StreamFuture
’s
implementation of Future::poll
consumes the underlying stream during polling
in order to return it to the caller of Future::poll
if the stream yielded
an element.
sourcepub fn into_inner(self) -> Option<St>
pub fn into_inner(self) -> Option<St>
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.
This method returns an Option
to account for the fact that StreamFuture
’s
implementation of Future::poll
consumes the underlying stream during polling
in order to return it to the caller of Future::poll
if the stream yielded
an element.
Trait Implementations
sourceimpl<St: Debug> Debug for StreamFuture<St>
impl<St: Debug> Debug for StreamFuture<St>
sourceimpl<St: Stream + Unpin> FusedFuture for StreamFuture<St>
impl<St: Stream + Unpin> FusedFuture for StreamFuture<St>
sourcefn is_terminated(&self) -> bool
fn is_terminated(&self) -> bool
true
if the underlying future should no longer be polled.