Skip to main content

AsyncParallelAdapter

Struct AsyncParallelAdapter 

Source
pub struct AsyncParallelAdapter<I> { /* private fields */ }
Expand description

Adapter to make async iterators work with parallel processing

Trait Implementations§

Source§

impl<I: AsyncIterator> AsyncIterator for AsyncParallelAdapter<I>

Source§

type Item = <I as AsyncIterator>::Item

The type of items yielded by this async iterator
Source§

fn into_vec(self) -> Vec<Self::Item>

Materialize the iterator into its logical item sequence.
Source§

fn map<F, Fut, R>(self, map_fn: F) -> AsyncMap<Self, F>
where Self: Sized, F: Fn(Self::Item) -> Fut + Send + Sync, Fut: Future<Output = R> + Send, R: Send,

Async map operation that transforms each element
Source§

fn filter<F, Fut>(self, filter_fn: F) -> AsyncFilter<Self, F>
where Self: Sized, F: Fn(&Self::Item) -> Fut + Send + Sync, Fut: Future<Output = bool> + Send,

Async filter operation
Source§

fn take(self, count: usize) -> AsyncTake<Self>
where Self: Sized,

Retain at most count items from the logical async stream prefix.
Source§

fn skip(self, count: usize) -> AsyncSkip<Self>
where Self: Sized,

Discard count items from the logical async stream prefix.
Source§

fn enumerate(self) -> AsyncEnumerate<Self>
where Self: Sized,

Pair each item with its zero-based logical stream position.
Source§

fn zip<J>(self, other: J) -> AsyncZip<Self, J>
where Self: Sized, J: AsyncIterator,

Pair items with another async iterator, stopping at the shorter input.
Source§

fn for_each<F, Fut>(self, func: F) -> AsyncForEach<Self, F> ⓘ
where Self: Sized, F: Fn(Self::Item) -> Fut + Send + Sync, Fut: Future<Output = ()> + Send,

Async for_each operation with side effects
Source§

fn collect<C>(self) -> AsyncCollect<Self, C> ⓘ
where Self: Sized, C: Default + Extend<Self::Item> + Send,

Collect into a vector asynchronously
Source§

fn fold<T, F, Fut>(self, init: T, fold_fn: F) -> AsyncFold<Self, T, F> ⓘ
where Self: Sized, F: Fn(T, Self::Item) -> Fut + Send + Sync, Fut: Future<Output = T> + Send, T: Send,

Fold operation with async function
Source§

fn reduce<F, Fut>(self, reduce_fn: F) -> AsyncReduce<Self, F> ⓘ
where Self: Sized, F: Fn(Self::Item, Self::Item) -> Fut + Send + Sync, Fut: Future<Output = Self::Item> + Send,

Reduce operation for async iterators
Source§

fn into_parallel(self) -> AsyncParallelAdapter<Self>
where Self: Sized,

Convert to parallel iterator for hybrid processing
Source§

impl<I: AsyncIterator> AsyncParallelIterator for AsyncParallelAdapter<I>

Source§

fn par_map<F, Fut, R>( self, concurrency: usize, map_fn: F, ) -> ParAsyncMap<Self, F>
where Self: Sized, F: Fn(Self::Item) -> Fut + Send + Sync, Fut: Future<Output = R> + Send, R: Send,

Execute async operations in parallel with controlled concurrency
Source§

fn par_filter<F, Fut>( self, concurrency: usize, filter_fn: F, ) -> ParAsyncFilter<Self, F>
where Self: Sized, F: Fn(&Self::Item) -> Fut + Send + Sync, Fut: Future<Output = bool> + Send,

Parallel async filter with concurrency control
Source§

fn par_for_each<F, Fut>( self, concurrency: usize, func: F, ) -> impl Future<Output = ()> + Send
where Self: Sized, F: Fn(Self::Item) -> Fut + Send + Sync, Fut: Future<Output = ()> + Send,

Execute side effects in parallel with async operations. Read more

Auto Trait Implementations§

§

impl<I> Freeze for AsyncParallelAdapter<I>
where I: Freeze,

§

impl<I> RefUnwindSafe for AsyncParallelAdapter<I>
where I: RefUnwindSafe,

§

impl<I> Send for AsyncParallelAdapter<I>
where I: Send,

§

impl<I> Sync for AsyncParallelAdapter<I>
where I: Sync,

§

impl<I> Unpin for AsyncParallelAdapter<I>
where I: Unpin,

§

impl<I> UnsafeUnpin for AsyncParallelAdapter<I>
where I: UnsafeUnpin,

§

impl<I> UnwindSafe for AsyncParallelAdapter<I>
where I: 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.