futures_buffered

Trait BufferedTryStreamExt

source
pub trait BufferedTryStreamExt: TryStream {
    // Provided methods
    fn try_buffered_ordered(self, n: usize) -> TryBufferedOrdered<Self>
       where Self::Ok: TryFuture<Err = Self::Err>,
             Self: Sized { ... }
    fn try_buffered_unordered(self, n: usize) -> TryBufferUnordered<Self>
       where Self::Ok: TryFuture<Err = Self::Err>,
             Self: Sized { ... }
}
Expand description

An extension trait for Streams that provides a variety of convenient combinator functions.

Provided Methods§

source

fn try_buffered_ordered(self, n: usize) -> TryBufferedOrdered<Self>
where Self::Ok: TryFuture<Err = Self::Err>, Self: Sized,

An adaptor for creating a buffered list of pending futures.

If this stream’s item can be converted into a future, then this adaptor will buffer up to at most n futures and then return the outputs in the same order as the underlying stream. No more than n futures will be buffered at any point in time, and less than n may also be buffered depending on the state of each future.

The returned stream will be a stream of each future’s output.

source

fn try_buffered_unordered(self, n: usize) -> TryBufferUnordered<Self>
where Self::Ok: TryFuture<Err = Self::Err>, Self: Sized,

An adaptor for creating a buffered list of pending futures (unordered).

If this stream’s item can be converted into a future, then this adaptor will buffer up to n futures and then return the outputs in the order in which they complete. No more than n futures will be buffered at any point in time, and less than n may also be buffered depending on the state of each future.

The returned stream will be a stream of each future’s output.

Implementors§