ParBlockingBuilder

Struct ParBlockingBuilder 

Source
pub struct ParBlockingBuilder<St, Fac, Out>
where St: ?Sized + Stream, St::Item: 'static + Send, Fac: FnFactory<St::Item, Out>, Fac::Fn: 'static + Send + FnOnce() -> Out, Out: 'static + Send,
{ /* private fields */ }
Expand description

The parallel stream builder with scheduled blocking tasks.

Implementations§

Source§

impl<St, Fac, Out> ParBlockingBuilder<St, Fac, Out>
where St: Stream, St::Item: 'static + Send, Fac: 'static + Send + FnFactory<St::Item, Out>, Fac::Fn: 'static + Send + FnOnce() -> Out, Out: 'static + Send,

Source

pub fn map_async<NewFac, NewFut>( self, new_fac: NewFac, ) -> ParAsyncBuilder<St, ComposeFutureFactory<St::Item, impl FnMut(St::Item) -> JoinHandle<Out>, NewFac>>
where NewFac: Send + Clone + FnMut(Out) -> NewFut, NewFut: 'static + Send + Future, NewFut::Output: 'static + Send,

Schedule an asynchronous task.

Source

pub fn map_blocking<NewOut, NewFac, NewFunc>( self, new_fac: NewFac, ) -> ParBlockingBuilder<St, BoxFnFactory<St::Item, NewOut>, NewOut>
where NewFac: 'static + Send + Clone + FnMut(Out) -> NewFunc, NewFunc: 'static + Send + FnOnce() -> NewOut, NewFunc::Output: 'static + Send,

Schedule a blocking task.

Source

pub fn build_unordered_stream<P>(self, params: P) -> UnorderedStream<Out>
where St: 'static + Send, P: Into<ParParams>,

Creates a stream that runs scheduled parallel tasks, which output does not respect the input order.

Source

pub fn build_ordered_stream<P>(self, params: P) -> OrderedStream<Out>
where St: 'static + Send, P: Into<ParParams>,

Creates a stream that runs scheduled parallel tasks, which output respects the input order.

Source§

impl<St, Fac> ParBlockingBuilder<St, Fac, ()>
where St: 'static + Send + Stream, St::Item: 'static + Send, Fac: 'static + Send + FnFactory<St::Item, ()>, Fac::Fn: 'static + Send + FnOnce(),

Source

pub async fn for_each<P>(self, params: P)
where P: Into<ParParams>,

Runs parallel tasks on each stream item.

Auto Trait Implementations§

§

impl<St, Fac, Out> Freeze for ParBlockingBuilder<St, Fac, Out>
where Fac: Freeze, St: Freeze + ?Sized,

§

impl<St, Fac, Out> RefUnwindSafe for ParBlockingBuilder<St, Fac, Out>

§

impl<St, Fac, Out> Send for ParBlockingBuilder<St, Fac, Out>
where Fac: Send, St: Send + ?Sized,

§

impl<St, Fac, Out> Sync for ParBlockingBuilder<St, Fac, Out>
where Fac: Sync, St: Sync + ?Sized, Out: Sync,

§

impl<St, Fac, Out> Unpin for ParBlockingBuilder<St, Fac, Out>
where Fac: Unpin, St: Unpin + ?Sized, Out: Unpin,

§

impl<St, Fac, Out> UnwindSafe for ParBlockingBuilder<St, Fac, Out>
where Fac: UnwindSafe, St: UnwindSafe + ?Sized, Out: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.