Struct par_stream::builder::ParAsyncBuilder
source · [−]pub struct ParAsyncBuilder<St, Fac> where
St: ?Sized + Stream,
St::Item: 'static + Send,
Fac: FutureFactory<St::Item>,
Fac::Fut: 'static + Send + Future,
<Fac::Fut as Future>::Output: Send, { /* private fields */ }
Expand description
The parallel stream builder with scheduled asynchronous tasks.
Implementations
sourceimpl<St, Fac> ParAsyncBuilder<St, Fac> where
St: Stream,
St::Item: 'static + Send,
Fac: 'static + Send + FutureFactory<St::Item>,
Fac::Fut: 'static + Send + Future,
<Fac::Fut as Future>::Output: 'static + Send,
impl<St, Fac> ParAsyncBuilder<St, Fac> where
St: Stream,
St::Item: 'static + Send,
Fac: 'static + Send + FutureFactory<St::Item>,
Fac::Fut: 'static + Send + Future,
<Fac::Fut as Future>::Output: 'static + Send,
sourcepub fn map_async<NewFac, NewFut>(
self,
new_fac: NewFac
) -> ParAsyncBuilder<St, ComposeFutureFactory<St::Item, Fac, NewFac>> where
NewFac: 'static + Send + Clone + FnMut(<Fac::Fut as Future>::Output) -> NewFut,
NewFut: 'static + Send + Future,
NewFut::Output: 'static + Send,
pub fn map_async<NewFac, NewFut>(
self,
new_fac: NewFac
) -> ParAsyncBuilder<St, ComposeFutureFactory<St::Item, Fac, NewFac>> where
NewFac: 'static + Send + Clone + FnMut(<Fac::Fut as Future>::Output) -> NewFut,
NewFut: 'static + Send + Future,
NewFut::Output: 'static + Send,
Schedule an asynchronous task.
sourcepub fn map_blocking<NewOut, NewFac, NewFunc>(
self,
new_fac: NewFac
) -> ParAsyncTailBlockBuilder<St, Fac, NewFac, NewOut> where
NewFac: 'static + Send + Clone + FnMut(<Fac::Fut as Future>::Output) -> NewFunc,
NewFunc: 'static + Send + FnOnce() -> NewOut,
NewFunc::Output: 'static + Send,
pub fn map_blocking<NewOut, NewFac, NewFunc>(
self,
new_fac: NewFac
) -> ParAsyncTailBlockBuilder<St, Fac, NewFac, NewOut> where
NewFac: 'static + Send + Clone + FnMut(<Fac::Fut as Future>::Output) -> NewFunc,
NewFunc: 'static + Send + FnOnce() -> NewOut,
NewFunc::Output: 'static + Send,
Schedules a blocking task.
The worker thread will pass the blocking task to a blocking thread and wait for the task to finish. It will introduce overhead on spawning blocking threads.
sourcepub fn build_unordered_stream<P>(
self,
params: P
) -> UnorderedStream<<Fac::Fut as Future>::Output> where
St: 'static + Send,
P: Into<ParParams>,
pub fn build_unordered_stream<P>(
self,
params: P
) -> UnorderedStream<<Fac::Fut as Future>::Output> where
St: 'static + Send,
P: Into<ParParams>,
Creates a stream that runs scheduled parallel tasks, which output does not respect the input order.
sourcepub fn build_ordered_stream<P>(
self,
params: P
) -> OrderedStream<<Fac::Fut as Future>::Output> where
St: 'static + Send,
P: Into<ParParams>,
pub fn build_ordered_stream<P>(
self,
params: P
) -> OrderedStream<<Fac::Fut as Future>::Output> where
St: 'static + Send,
P: Into<ParParams>,
Creates a stream that runs scheduled parallel tasks, which output respects the input order.
sourceimpl<St, Fac> ParAsyncBuilder<St, Fac> where
St: 'static + Send + Stream,
St::Item: 'static + Send,
Fac: 'static + Send + FutureFactory<St::Item>,
Fac::Fut: 'static + Send + Future<Output = ()>,
impl<St, Fac> ParAsyncBuilder<St, Fac> where
St: 'static + Send + Stream,
St::Item: 'static + Send,
Fac: 'static + Send + FutureFactory<St::Item>,
Fac::Fut: 'static + Send + Future<Output = ()>,
sourceimpl<St, Fac, Error> ParAsyncBuilder<St, Fac> where
St: 'static + Send + Stream,
St::Item: 'static + Send,
Fac: 'static + Send + FutureFactory<St::Item>,
Fac::Fut: 'static + Send + Future<Output = Result<(), Error>>,
Error: 'static + Send,
impl<St, Fac, Error> ParAsyncBuilder<St, Fac> where
St: 'static + Send + Stream,
St::Item: 'static + Send,
Fac: 'static + Send + FutureFactory<St::Item>,
Fac::Fut: 'static + Send + Future<Output = Result<(), Error>>,
Error: 'static + Send,
Auto Trait Implementations
impl<St: ?Sized, Fac> RefUnwindSafe for ParAsyncBuilder<St, Fac> where
Fac: RefUnwindSafe,
St: RefUnwindSafe,
impl<St: ?Sized, Fac> Send for ParAsyncBuilder<St, Fac> where
Fac: Send,
St: Send,
impl<St: ?Sized, Fac> Sync for ParAsyncBuilder<St, Fac> where
Fac: Sync,
St: Sync,
impl<St: ?Sized, Fac> Unpin for ParAsyncBuilder<St, Fac> where
Fac: Unpin,
St: Unpin,
impl<St: ?Sized, Fac> UnwindSafe for ParAsyncBuilder<St, Fac> where
Fac: UnwindSafe,
St: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more