pub struct StreamFuture<T> { /* private fields */ }Expand description
A future that waits for a stream value.
This is created by Stream::next.
Implementations§
Source§impl<T: Clone + Send + 'static> StreamFuture<T>
impl<T: Clone + Send + 'static> StreamFuture<T>
Sourcepub fn get_source(&self) -> &Stream<T>
pub fn get_source(&self) -> &Stream<T>
Obtains the source stream.
Sourcepub fn reload(&self)
pub fn reload(&self)
Reuses a finished future so it can wait for another value.
Normally calling poll on a future after it returned Poll::Ready will panic.
This method will restart this future so it can be polled again for another value.
This allows awaiting for multiple values without having to create and allocate multiple
future objects.
Calling this on a pending (or ready but unread) future will have no effect.
Trait Implementations§
Source§impl<T: Debug> Debug for StreamFuture<T>
impl<T: Debug> Debug for StreamFuture<T>
Source§impl<T> Future for StreamFuture<T>
impl<T> Future for StreamFuture<T>
impl<T> Unpin for StreamFuture<T>
Auto Trait Implementations§
impl<T> Freeze for StreamFuture<T>
impl<T> !RefUnwindSafe for StreamFuture<T>
impl<T> Send for StreamFuture<T>where
T: Send,
impl<T> Sync for StreamFuture<T>where
T: Send,
impl<T> UnsafeUnpin for StreamFuture<T>
impl<T> !UnwindSafe for StreamFuture<T>
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
Mutably borrows from an owned value. Read more
Source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more