seq_io_parallel::processor

Trait ParallelProcessor

Source
pub trait ParallelProcessor: Send + Clone {
    // Required method
    fn process_record<'a, Rf: MinimalRefRecord<'a>>(
        &mut self,
        record: Rf,
    ) -> Result<()>;

    // Provided methods
    fn on_batch_complete(&mut self) -> Result<()> { ... }
    fn on_thread_complete(&mut self) -> Result<()> { ... }
    fn set_thread_id(&mut self, thread_id: usize) { ... }
    fn get_thread_id(&self) -> usize { ... }
}
Expand description

Trait implemented for a type that processes records in parallel

Required Methods§

Source

fn process_record<'a, Rf: MinimalRefRecord<'a>>( &mut self, record: Rf, ) -> Result<()>

Called on an individual record

Provided Methods§

Source

fn on_batch_complete(&mut self) -> Result<()>

Called when a batch of records is complete

Source

fn on_thread_complete(&mut self) -> Result<()>

Called when the processing for a thread is complete

Source

fn set_thread_id(&mut self, thread_id: usize)

Sets the thread id for the processor

Source

fn get_thread_id(&self) -> usize

Gets the thread id for the processor

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§