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
Returns true
if the underlying future should no longer be polled.
sourceimpl<St: Stream + Unpin> Future for StreamFuture<St>
impl<St: Stream + Unpin> Future for StreamFuture<St>
Auto Trait Implementations
impl<St> RefUnwindSafe for StreamFuture<St> where
St: RefUnwindSafe,
impl<St> Send for StreamFuture<St> where
St: Send,
impl<St> Sync for StreamFuture<St> where
St: Sync,
impl<St> Unpin for StreamFuture<St> where
St: Unpin,
impl<St> UnwindSafe for StreamFuture<St> where
St: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<F> IntoFuture for F where
F: Future,
impl<F> IntoFuture for F where
F: Future,
type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
sourcefn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more