pub trait WidebandExt<Item>{
// Required methods
fn widen_filter_map<F, Fut, U, N>(
self,
n: N,
f: F,
) -> impl Stream<Item = U> + Send
where N: Into<Option<usize>>,
F: Fn(Item) -> Fut + Send,
Fut: Future<Output = Option<U>> + Send,
U: Send;
fn widen_then<F, Fut, U, N>(
self,
n: N,
f: F,
) -> impl Stream<Item = U> + Send
where N: Into<Option<usize>>,
F: Fn(Item) -> Fut + Send,
Fut: Future<Output = U> + Send,
U: Send;
// Provided methods
fn wide_filter_map<F, Fut, U>(self, f: F) -> impl Stream<Item = U> + Send
where F: Fn(Item) -> Fut + Send,
Fut: Future<Output = Option<U>> + Send,
U: Send { ... }
fn wide_then<F, Fut, U>(self, f: F) -> impl Stream<Item = U> + Send
where F: Fn(Item) -> Fut + Send,
Fut: Future<Output = U> + Send,
U: Send { ... }
}Expand description
Adds bounded concurrent transformations that preserve stream order.
Multiple item futures may run ahead of downstream demand. Completed outputs are held until every earlier input has produced its output.
Required Methods§
Sourcefn widen_filter_map<F, Fut, U, N>(
self,
n: N,
f: F,
) -> impl Stream<Item = U> + Send
fn widen_filter_map<F, Fut, U, N>( self, n: N, f: F, ) -> impl Stream<Item = U> + Send
Maps and filters items concurrently with an explicit width.
n limits in-flight item futures, while None selects the automatic
width; an explicit zero cannot make progress. Present outputs retain
source order and absent outputs are omitted.
Sourcefn widen_then<F, Fut, U, N>(self, n: N, f: F) -> impl Stream<Item = U> + Send
fn widen_then<F, Fut, U, N>(self, n: N, f: F) -> impl Stream<Item = U> + Send
Maps items concurrently with an explicit width while preserving order.
n limits in-flight item futures, while None selects the automatic
width; an explicit zero cannot make progress. Item futures may run
ahead, but outputs retain source order.
Provided Methods§
Sourcefn wide_filter_map<F, Fut, U>(self, f: F) -> impl Stream<Item = U> + Send
fn wide_filter_map<F, Fut, U>(self, f: F) -> impl Stream<Item = U> + Send
Maps and filters items concurrently with the automatic width.
Present outputs retain source order even when their futures complete out of order. Absent outputs are omitted.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".