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§
Sourcefn process_record<'a, Rf: MinimalRefRecord<'a>>(
&mut self,
record: Rf,
) -> Result<()>
fn process_record<'a, Rf: MinimalRefRecord<'a>>( &mut self, record: Rf, ) -> Result<()>
Called on an individual record
Provided Methods§
Sourcefn on_batch_complete(&mut self) -> Result<()>
fn on_batch_complete(&mut self) -> Result<()>
Called when a batch of records is complete
Sourcefn on_thread_complete(&mut self) -> Result<()>
fn on_thread_complete(&mut self) -> Result<()>
Called when the processing for a thread is complete
Sourcefn set_thread_id(&mut self, thread_id: usize)
fn set_thread_id(&mut self, thread_id: usize)
Sets the thread id for the processor
Sourcefn get_thread_id(&self) -> usize
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.