Trait ParallelReader

Source
pub trait ParallelReader {
    // Required methods
    fn process_parallel<P: ParallelProcessor + Clone + 'static>(
        self,
        processor: P,
        num_threads: usize,
    ) -> Result<()>;
    fn process_parallel_range<P: ParallelProcessor + Clone + 'static>(
        self,
        processor: P,
        num_threads: usize,
        range: Range<usize>,
    ) -> Result<()>;
}
Expand description

Trait for BINSEQ readers that can process records in parallel

This is implemented by the reader not by the processor. For the processor, see the ParallelProcessor trait.

Required Methods§

Source

fn process_parallel<P: ParallelProcessor + Clone + 'static>( self, processor: P, num_threads: usize, ) -> Result<()>

Source

fn process_parallel_range<P: ParallelProcessor + Clone + 'static>( self, processor: P, num_threads: usize, range: Range<usize>, ) -> Result<()>

Process records in parallel within a specified range

This method allows parallel processing of a subset of records within the file, defined by a start and end index. The range is distributed across the specified number of threads.

§Arguments
  • processor - The processor to use for each record
  • num_threads - The number of threads to spawn
  • range - The range of record indices to process
§Returns
  • Ok(()) - If all records were processed successfully
  • Err(Error) - If an error occurred during processing

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl ParallelReader for BinseqReader

Source§

impl ParallelReader for binseq::bq::MmapReader

Parallel processing implementation for memory-mapped readers

Source§

impl ParallelReader for binseq::vbq::MmapReader