pub trait TryParallelExt<T, E>where
Self: TryStream<Ok = T, Error = E, Item = Result<T, E>> + Send + Sized,
E: From<JoinError> + From<Error> + Send + 'static,
T: Send + 'static,{
// Required method
fn paralleln_and_then<U, F, N, H>(
self,
h: H,
n: N,
f: F,
) -> impl TryStream<Ok = U, Error = E, Item = Result<U, E>> + Send
where N: Into<Option<usize>>,
H: Into<Option<Handle>>,
F: Fn(Self::Ok) -> Result<U, E> + Clone + Send + 'static,
U: Send + 'static;
// Provided method
fn parallel_and_then<U, F, H>(
self,
h: H,
f: F,
) -> impl TryStream<Ok = U, Error = E, Item = Result<U, E>> + Send
where H: Into<Option<Handle>>,
F: Fn(Self::Ok) -> Result<U, E> + Clone + Send + 'static,
U: Send + 'static { ... }
}Expand description
Parallelism extensions to augment futures::StreamExt. These combinators are for computation-oriented workloads, unlike -band combinators for I/O workloads; these default to the available compute parallelism for the system. Threads are currently drawn from the tokio-spawn pool. Results are unordered.
Required Methods§
fn paralleln_and_then<U, F, N, H>( self, h: H, n: N, f: F, ) -> impl TryStream<Ok = U, Error = E, Item = Result<U, E>> + Send
Provided Methods§
fn parallel_and_then<U, F, H>( self, h: H, f: F, ) -> impl TryStream<Ok = U, Error = E, Item = Result<U, E>> + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.