Trait TryStreamAndThenExt

Source
pub trait TryStreamAndThenExt: TryStream {
    // Required method
    fn and_then_concurrent<Fut, F>(
        self,
        f: F,
    ) -> AndThenConcurrent<Self, Fut, F>
       where Self: Sized,
             Fut: TryFuture<Error = Self::Error>,
             F: FnMut(Self::Ok) -> Fut;
}
Expand description

Required Methods§

Source

fn and_then_concurrent<Fut, F>(self, f: F) -> AndThenConcurrent<Self, Fut, F>
where Self: Sized, Fut: TryFuture<Error = Self::Error>, F: FnMut(Self::Ok) -> Fut,

Chain a computation when a stream value is ready, passing Ok values to the closure f.

This function is similar to futures_util::stream::TryStreamExt::and_then, but the stream is polled concurrently with the futures returned by f. An unbounded number of futures corresponding to past stream values is kept via FuturesUnordered.

See crate-level docs for an explanation and usage example.

Implementors§