Skip to main content

TryBroadbandExt

Trait TryBroadbandExt 

Source
pub trait TryBroadbandExt<T, E>
where Self: TryStream<Ok = T, Error = E, Item = Result<T, E>> + Send + Sized,
{ // Required method fn broadn_and_then<U, F, Fut, N>( self, n: N, f: F, ) -> impl TryStream<Ok = U, Error = E, Item = Result<U, E>> + Send where N: Into<Option<usize>>, F: Fn(Self::Ok) -> Fut + Send, Fut: TryFuture<Ok = U, Error = E, Output = Result<U, E>> + Send; // Provided method fn broad_and_then<U, F, Fut>( self, f: F, ) -> impl TryStream<Ok = U, Error = E, Item = Result<U, E>> + Send where F: Fn(Self::Ok) -> Fut + Send, Fut: TryFuture<Ok = U, Error = E, Output = Result<U, E>> + Send { ... } }
Expand description

Adds bounded concurrent transformations with completion-ordered outputs.

Successful item futures may run ahead of downstream demand, and their results are yielded as they complete. Source errors bypass the transform and may overtake queued item futures.

Required Methods§

Source

fn broadn_and_then<U, F, Fut, N>( self, n: N, f: F, ) -> impl TryStream<Ok = U, Error = E, Item = Result<U, E>> + Send
where N: Into<Option<usize>>, F: Fn(Self::Ok) -> Fut + Send, Fut: TryFuture<Ok = U, Error = E, Output = Result<U, E>> + Send,

Transforms successful items concurrently with an explicit width.

n limits in-flight item futures, while None selects the automatic width; an explicit zero cannot make progress. Transformation results are completion ordered, while source errors bypass f and may overtake them.

Provided Methods§

Source

fn broad_and_then<U, F, Fut>( self, f: F, ) -> impl TryStream<Ok = U, Error = E, Item = Result<U, E>> + Send
where F: Fn(Self::Ok) -> Fut + Send, Fut: TryFuture<Ok = U, Error = E, Output = Result<U, E>> + Send,

Transforms successful items concurrently with the automatic width.

Transformation results are yielded in completion order rather than source order. Existing source errors bypass f and may overtake queued futures.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T, E, S> TryBroadbandExt<T, E> for S
where S: TryStream<Ok = T, Error = E, Item = Result<T, E>> + Send + Sized,