pub struct StreamFuture<S> { /* private fields */ }
Expand description
A combinator used to temporarily convert a stream into a future.
This future is returned by the Stream::next
method.
Implementations§
Source§impl<S> StreamFuture<S>
impl<S> StreamFuture<S>
Sourcepub fn get_ref(&self) -> Option<&S>
pub fn get_ref(&self) -> Option<&S>
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 S>
pub fn get_mut(&mut self) -> Option<&mut S>
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 into_inner(self) -> Option<S>
pub fn into_inner(self) -> Option<S>
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<S> Debug for StreamFuture<S>where
S: Debug,
impl<S> Debug for StreamFuture<S>where
S: Debug,
Source§impl<S> Future for StreamFuture<S>where
S: Stream,
impl<S> Future for StreamFuture<S>where
S: Stream,
Auto Trait Implementations§
impl<S> Freeze for StreamFuture<S>where
S: Freeze,
impl<S> RefUnwindSafe for StreamFuture<S>where
S: RefUnwindSafe,
impl<S> Send for StreamFuture<S>where
S: Send,
impl<S> Sync for StreamFuture<S>where
S: Sync,
impl<S> Unpin for StreamFuture<S>where
S: Unpin,
impl<S> UnwindSafe for StreamFuture<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn map<U, F>(self, f: F) -> Map<Self, F>
fn map<U, F>(self, f: F) -> Map<Self, F>
Source§fn map_err<E, F>(self, f: F) -> MapErr<Self, F>
fn map_err<E, F>(self, f: F) -> MapErr<Self, F>
Source§fn err_into<E>(self) -> ErrInto<Self, E>
fn err_into<E>(self) -> ErrInto<Self, E>
Into
trait. Read moreSource§fn then<B, F>(self, f: F) -> Then<Self, B, F>
fn then<B, F>(self, f: F) -> Then<Self, B, F>
f
. Read moreSource§fn and_then<B, F>(self, f: F) -> AndThen<Self, B, F>
fn and_then<B, F>(self, f: F) -> AndThen<Self, B, F>
Source§fn or_else<B, F>(self, f: F) -> OrElse<Self, B, F>
fn or_else<B, F>(self, f: F) -> OrElse<Self, B, F>
Source§fn select<B>(self, other: B) -> Select<Self, <B as IntoFuture>::Future>where
B: IntoFuture,
Self: Sized,
fn select<B>(self, other: B) -> Select<Self, <B as IntoFuture>::Future>where
B: IntoFuture,
Self: Sized,
Source§fn join<B>(self, other: B) -> Join<Self, <B as IntoFuture>::Future>
fn join<B>(self, other: B) -> Join<Self, <B as IntoFuture>::Future>
Source§fn join3<B, C>(
self,
b: B,
c: C,
) -> Join3<Self, <B as IntoFuture>::Future, <C as IntoFuture>::Future>
fn join3<B, C>( self, b: B, c: C, ) -> Join3<Self, <B as IntoFuture>::Future, <C as IntoFuture>::Future>
join
, but with more futures.Source§fn join4<B, C, D>(
self,
b: B,
c: C,
d: D,
) -> Join4<Self, <B as IntoFuture>::Future, <C as IntoFuture>::Future, <D as IntoFuture>::Future>where
B: IntoFuture<Error = Self::Error>,
C: IntoFuture<Error = Self::Error>,
D: IntoFuture<Error = Self::Error>,
Self: Sized,
fn join4<B, C, D>(
self,
b: B,
c: C,
d: D,
) -> Join4<Self, <B as IntoFuture>::Future, <C as IntoFuture>::Future, <D as IntoFuture>::Future>where
B: IntoFuture<Error = Self::Error>,
C: IntoFuture<Error = Self::Error>,
D: IntoFuture<Error = Self::Error>,
Self: Sized,
join
, but with more futures.Source§fn join5<B, C, D, E>(
self,
b: B,
c: C,
d: D,
e: E,
) -> Join5<Self, <B as IntoFuture>::Future, <C as IntoFuture>::Future, <D as IntoFuture>::Future, <E as IntoFuture>::Future>where
B: IntoFuture<Error = Self::Error>,
C: IntoFuture<Error = Self::Error>,
D: IntoFuture<Error = Self::Error>,
E: IntoFuture<Error = Self::Error>,
Self: Sized,
fn join5<B, C, D, E>(
self,
b: B,
c: C,
d: D,
e: E,
) -> Join5<Self, <B as IntoFuture>::Future, <C as IntoFuture>::Future, <D as IntoFuture>::Future, <E as IntoFuture>::Future>where
B: IntoFuture<Error = Self::Error>,
C: IntoFuture<Error = Self::Error>,
D: IntoFuture<Error = Self::Error>,
E: IntoFuture<Error = Self::Error>,
Self: Sized,
join
, but with more futures.Source§fn left_future<B>(self) -> Either<Self, B> ⓘ
fn left_future<B>(self) -> Either<Self, B> ⓘ
Source§fn right_future<A>(self) -> Either<A, Self> ⓘ
fn right_future<A>(self) -> Either<A, Self> ⓘ
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>
fn flatten(self) -> Flatten<Self>
Source§fn flatten_sink(self) -> FlattenSink<Self>
fn flatten_sink(self) -> FlattenSink<Self>
Source§fn flatten_stream(self) -> FlattenStream<Self>
fn flatten_stream(self) -> FlattenStream<Self>
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. Read moreSource§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
Source§fn inspect_err<F>(self, f: F) -> InspectErr<Self, F>
fn inspect_err<F>(self, f: F) -> InspectErr<Self, F>
Source§fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
Source§fn recover<E, F>(self, f: F) -> Recover<Self, E, F>
fn recover<E, F>(self, f: F) -> Recover<Self, E, F>
Self::Item
. Read moreSource§fn with_executor<E>(self, executor: E) -> WithExecutor<Self, E>
fn with_executor<E>(self, executor: E) -> WithExecutor<Self, E>
Executor
to be used when spawning tasks
from within the future. Read moreSource§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more