Struct StreamFuture
#[must_use = "futures do nothing unless you `.await` or poll them"]
pub struct StreamFuture<St> { /* private fields */ }
Future for the into_future method.
Implementations
impl<St: Stream + Unpin> StreamFuture<St>
fn get_ref(&self) -> Option<&St>Acquires a reference to the underlying stream that this combinator is pulling from.
This method returns an
Optionto account for the fact thatStreamFuture's implementation ofFuture::pollconsumes the underlying stream during polling in order to return it to the caller ofFuture::pollif the stream yielded an element.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
Optionto account for the fact thatStreamFuture's implementation ofFuture::pollconsumes the underlying stream during polling in order to return it to the caller ofFuture::pollif the stream yielded an element.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
Optionto account for the fact thatStreamFuture's implementation ofFuture::pollconsumes the underlying stream during polling in order to return it to the caller ofFuture::pollif the stream yielded an element.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
Optionto account for the fact thatStreamFuture's implementation ofFuture::pollconsumes the underlying stream during polling in order to return it to the caller ofFuture::pollif the stream yielded an element.
Trait Implementations
impl<St: Debug> Debug for StreamFuture<St>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<St: Stream + Unpin> FusedFuture for StreamFuture<St>
fn is_terminated(&self) -> bool
impl<St: Stream + Unpin> Future for StreamFuture<St>
type Output = (Option<<St as Stream>::Item>, St);fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
Auto Trait Implementations
impl<St> Freeze for StreamFuture<St>
where
Option<St>: Freeze,
impl<St> RefUnwindSafe for StreamFuture<St>
where
Option<St>: RefUnwindSafe,
impl<St> Send for StreamFuture<St>
where
Option<St>: Send,
impl<St> Sync for StreamFuture<St>
where
Option<St>: Sync,
impl<St> Unpin for StreamFuture<St>
where
Option<St>: Unpin,
impl<St> UnsafeUnpin for StreamFuture<St>
where
Option<St>: UnsafeUnpin,
impl<St> UnwindSafe for StreamFuture<St>
where
Option<St>: UnwindSafe,
Blanket Implementations
impl<F> IntoFuture for StreamFuture<St>
where
F: Future,
type Output = <F as Future>::Output;type IntoFuture = F;fn into_future(self) -> <F as IntoFuture>::IntoFuture
impl<T> Any for StreamFuture<St>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for StreamFuture<St>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for StreamFuture<St>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for StreamFuture<St>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> FutureExt for StreamFuture<St>
where
T: Future + ?Sized,
impl<T, U> Into<U> for StreamFuture<St>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for StreamFuture<St>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for StreamFuture<St>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>