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§
Sourcefn process_record<R: BinseqRecord>(&mut self, record: R) -> Result<()>
fn process_record<R: BinseqRecord>(&mut self, record: R) -> Result<()>
Process a single record
Provided Methods§
Sourcefn on_batch_complete(&mut self) -> Result<()>
fn on_batch_complete(&mut self) -> Result<()>
Called when a thread finishes processing its batch Default implementation does nothing
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.