Struct futures_util::stream::StreamFuture
source · pub struct StreamFuture<St> { /* private fields */ }
Expand description
Future for the into_future
method.
Implementations§
source§impl<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§
source§impl<St: Debug> Debug for StreamFuture<St>
impl<St: Debug> Debug for StreamFuture<St>
source§impl<St: Stream + Unpin> FusedFuture for StreamFuture<St>
impl<St: Stream + Unpin> FusedFuture for StreamFuture<St>
source§fn is_terminated(&self) -> bool
fn is_terminated(&self) -> bool
true
if the underlying future should no longer be polled.