Skip to main content

TryWidebandExt

Trait TryWidebandExt 

Source
pub trait TryWidebandExt<T, E>
where Self: TryStream<Ok = T, Error = E, Item = Result<T, E>> + Send + Sized,
{ // Required method fn widen_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, U: Send; // Provided method fn wide_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, U: Send { ... } }
Expand description

Adds bounded concurrent transformations with ordered transform results.

Successful item futures may run ahead of downstream demand, and their results retain queue order. Source errors are propagated immediately and may overtake queued transformation futures.

Required Methods§

Source

fn widen_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, U: 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 retain queue order, while source errors may overtake them.

Provided Methods§

Source

fn wide_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, U: Send,

Transforms successful items concurrently with the automatic width.

Item futures may run ahead, but transformation results retain queue 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> TryWidebandExt<T, E> for S
where S: TryStream<Ok = T, Error = E, Item = Result<T, E>> + Send + Sized, E: Send,