pub struct FutureStream<T: Send> { /* private fields */ }Expand description
Stream of multiple Futures
A FutureStream can be used to wait for multiple Futures, and return them incrementally as
they are resolved.
It implements an iterator over completed Futures, and can be constructed from an iterator of
Futures.
May be cloned and the clones passed to other threads so that Futures may be added from multiple
threads.
Implementations§
Source§impl<T: Send> FutureStream<T>
impl<T: Send> FutureStream<T>
pub fn new() -> FutureStream<T>
Sourcepub fn outstanding(&self) -> usize
pub fn outstanding(&self) -> usize
Return number of outstanding Futures.
Sourcepub fn waiter<'fs>(&'fs self) -> FutureStreamWaiter<'fs, T>
pub fn waiter<'fs>(&'fs self) -> FutureStreamWaiter<'fs, T>
Return a singleton FutureStreamWaiter. If one already exists, block until it is released.
Sourcepub fn try_waiter<'fs>(&'fs self) -> Option<FutureStreamWaiter<'fs, T>>
pub fn try_waiter<'fs>(&'fs self) -> Option<FutureStreamWaiter<'fs, T>>
Return a singleton FutureStreamWaiter. Returns None if one already exists.
Trait Implementations§
Source§impl<T: Clone + Send> Clone for FutureStream<T>
impl<T: Clone + Send> Clone for FutureStream<T>
Source§fn clone(&self) -> FutureStream<T>
fn clone(&self) -> FutureStream<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Send + 'static> FromIterator<Future<T>> for FutureStream<T>
impl<T: Send + 'static> FromIterator<Future<T>> for FutureStream<T>
Source§impl<'a, T: Send + 'a> IntoIterator for &'a FutureStream<T>
impl<'a, T: Send + 'a> IntoIterator for &'a FutureStream<T>
Auto Trait Implementations§
impl<T> Freeze for FutureStream<T>
impl<T> RefUnwindSafe for FutureStream<T>
impl<T> Send for FutureStream<T>
impl<T> Sync for FutureStream<T>
impl<T> Unpin for FutureStream<T>
impl<T> UnwindSafe for FutureStream<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