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.source§impl<St: Stream + Unpin> Future for StreamFuture<St>
impl<St: Stream + Unpin> Future for StreamFuture<St>
Auto Trait Implementations§
impl<St> Freeze for StreamFuture<St>where
St: Freeze,
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§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> FutureExt for Twhere
T: Future + ?Sized,
impl<T> FutureExt for Twhere
T: Future + ?Sized,
source§fn map<U, F>(self, f: F) -> Map<Self, F> ⓘwhere
F: FnOnce(Self::Output) -> U,
Self: Sized,
fn map<U, F>(self, f: F) -> Map<Self, F> ⓘwhere
F: FnOnce(Self::Output) -> U,
Self: Sized,
source§fn map_into<U>(self) -> MapInto<Self, U> ⓘwhere
Self::Output: Into<U>,
Self: Sized,
fn map_into<U>(self) -> MapInto<Self, U> ⓘwhere
Self::Output: Into<U>,
Self: Sized,
source§fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> ⓘwhere
F: FnOnce(Self::Output) -> Fut,
Fut: Future,
Self: Sized,
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> ⓘwhere
F: FnOnce(Self::Output) -> Fut,
Fut: Future,
Self: Sized,
f
. Read moresource§fn left_future<B>(self) -> Either<Self, B> ⓘwhere
B: Future<Output = Self::Output>,
Self: Sized,
fn left_future<B>(self) -> Either<Self, B> ⓘwhere
B: Future<Output = Self::Output>,
Self: Sized,
source§fn right_future<A>(self) -> Either<A, Self> ⓘwhere
A: Future<Output = Self::Output>,
Self: Sized,
fn right_future<A>(self) -> Either<A, Self> ⓘwhere
A: Future<Output = Self::Output>,
Self: Sized,
source§fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
source§fn flatten(self) -> Flatten<Self> ⓘwhere
Self::Output: Future,
Self: Sized,
fn flatten(self) -> Flatten<Self> ⓘwhere
Self::Output: Future,
Self: Sized,
source§fn flatten_stream(self) -> FlattenStream<Self>where
Self::Output: Stream,
Self: Sized,
fn flatten_stream(self) -> FlattenStream<Self>where
Self::Output: Stream,
Self: Sized,
source§fn fuse(self) -> Fuse<Self> ⓘwhere
Self: Sized,
fn fuse(self) -> Fuse<Self> ⓘwhere
Self: Sized,
poll
will never again be called once it has
completed. This method can be used to turn any Future
into a
FusedFuture
. Read moresource§fn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘwhere
F: FnOnce(&Self::Output),
Self: Sized,
fn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘwhere
F: FnOnce(&Self::Output),
Self: Sized,
source§fn unit_error(self) -> UnitError<Self> ⓘwhere
Self: Sized,
fn unit_error(self) -> UnitError<Self> ⓘwhere
Self: Sized,
Future<Output = T>
into a
TryFuture<Ok = T, Error = ()
>.source§fn never_error(self) -> NeverError<Self> ⓘwhere
Self: Sized,
fn never_error(self) -> NeverError<Self> ⓘwhere
Self: Sized,
Future<Output = T>
into a
TryFuture<Ok = T, Error = Never
>.source§fn poll_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Self::Output>where
Self: Unpin,
fn poll_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Self::Output>where
Self: Unpin,
Future::poll
on Unpin
future types.source§fn now_or_never(self) -> Option<Self::Output>where
Self: Sized,
fn now_or_never(self) -> Option<Self::Output>where
Self: Sized,
Future::poll
. Read more