pub struct ChunkingUtils;
Expand description
Enhanced chunking utilities
Implementations§
Source§impl ChunkingUtils
impl ChunkingUtils
Sourcepub fn optimal_chunk_size(data_size: usize, config: &ChunkConfig) -> usize
pub fn optimal_chunk_size(data_size: usize, config: &ChunkConfig) -> usize
Get the optimal chunk size based on data size and configuration
Sourcepub fn chunked_map<T, R, F>(
data: &[T],
config: &ChunkConfig,
map_fn: F,
) -> Vec<R>
pub fn chunked_map<T, R, F>( data: &[T], config: &ChunkConfig, map_fn: F, ) -> Vec<R>
Process data with optimal chunking strategy
Sourcepub fn chunked_zip_map<T, U, R, F>(
data_a: &[T],
data_b: &[U],
config: &ChunkConfig,
map_fn: F,
) -> Vec<R>
pub fn chunked_zip_map<T, U, R, F>( data_a: &[T], data_b: &[U], config: &ChunkConfig, map_fn: F, ) -> Vec<R>
Process pairs of data with optimal chunking
Sourcepub fn chunked_reduce<T, F>(
data: &[T],
config: &ChunkConfig,
identity: T,
reduce_fn: F,
) -> T
pub fn chunked_reduce<T, F>( data: &[T], config: &ChunkConfig, identity: T, reduce_fn: F, ) -> T
Reduce operation with optimal chunking
Auto Trait Implementations§
impl Freeze for ChunkingUtils
impl RefUnwindSafe for ChunkingUtils
impl Send for ChunkingUtils
impl Sync for ChunkingUtils
impl Unpin for ChunkingUtils
impl UnwindSafe for ChunkingUtils
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more