Skip to main content

TryParallelExt

Trait TryParallelExt 

Source
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§

Source

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 Methods§

Source

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,

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.

Implementors§

Source§

impl<T, E, S> TryParallelExt<T, E> for S
where S: TryStream<Ok = T, Error = E, Item = Result<T, E>> + Send + Sized, E: From<JoinError> + From<Error> + Send + 'static, T: Send + 'static,