Skip to main content

AdaptiveChunking

Trait AdaptiveChunking 

Source
pub trait AdaptiveChunking<A: Clone + Copy + 'static + Send + Sync> {
    // Required methods
    fn adaptive_chunking(
        &self,
        params: AdaptiveChunkingParams,
    ) -> CoreResult<AdaptiveChunkingResult>;
    fn process_chunks_adaptive<F, R>(
        &self,
        params: AdaptiveChunkingParams,
        f: F,
    ) -> CoreResult<Vec<R>>
       where F: Fn(&[A], usize) -> R;
    fn process_chunks_mut_adaptive<F>(
        &mut self,
        params: AdaptiveChunkingParams,
        f: F,
    ) -> CoreResult<()>
       where F: Fn(&mut [A], usize);
    fn process_chunks_parallel_adaptive<F, R>(
        &self,
        params: AdaptiveChunkingParams,
        f: F,
    ) -> CoreResult<Vec<R>>
       where F: Fn(&[A], usize) -> R + Send + Sync,
             R: Send,
             A: Send + Sync;
}
Expand description

Trait for adaptive chunking capabilities.

Required Methods§

Source

fn adaptive_chunking( &self, params: AdaptiveChunkingParams, ) -> CoreResult<AdaptiveChunkingResult>

Calculate an optimal chunking strategy based on array characteristics.

§Arguments
  • params - Parameters to guide the adaptive chunking process
§Returns

A result containing the recommended chunking strategy and metadata

Source

fn process_chunks_adaptive<F, R>( &self, params: AdaptiveChunkingParams, f: F, ) -> CoreResult<Vec<R>>
where F: Fn(&[A], usize) -> R,

Process chunks using an automatically determined optimal chunking strategy.

§Arguments
  • params - Parameters to guide the adaptive chunking process
  • f - Function to process each chunk
§Returns

A vector of results, one for each chunk

Source

fn process_chunks_mut_adaptive<F>( &mut self, params: AdaptiveChunkingParams, f: F, ) -> CoreResult<()>
where F: Fn(&mut [A], usize),

Process chunks mutably using an automatically determined optimal chunking strategy.

§Arguments
  • params - Parameters to guide the adaptive chunking process
  • f - Function to process each chunk
Source

fn process_chunks_parallel_adaptive<F, R>( &self, params: AdaptiveChunkingParams, f: F, ) -> CoreResult<Vec<R>>
where F: Fn(&[A], usize) -> R + Send + Sync, R: Send, A: Send + Sync,

Process chunks in parallel using an automatically determined optimal chunking strategy.

§Arguments
  • params - Parameters to guide the adaptive chunking process
  • f - Function to process each chunk
§Returns

A vector of results, one for each chunk

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<A: Clone + Copy + 'static + Send + Sync> AdaptiveChunking<A> for MemoryMappedArray<A>