ParallelProcessor

Trait ParallelProcessor 

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

    // Provided methods
    fn on_batch_complete(&mut self) -> Result<()> { ... }
    fn set_tid(&mut self, _tid: usize) { ... }
    fn get_tid(&self) -> Option<usize> { ... }
}
Expand description

Trait for types that can process records in parallel.

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

Required Methods§

Source

fn process_record<R: BinseqRecord>(&mut self, record: R) -> Result<()>

Process a single record

Provided Methods§

Source

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

Called when a thread finishes processing its batch Default implementation does nothing

Source

fn set_tid(&mut self, _tid: usize)

Set the thread ID for this processor

Each thread should call this method with its own unique ID.

Source

fn get_tid(&self) -> Option<usize>

Get the thread ID for this 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§