pub fn write_record(&mut self, record: NextalignRecord) -> Result<(), Report> {
    if !self.in_order {
      // Out-of-order mode: write immediately
      self.write_impl(&record)?;
    } else {
      // In-order mode: check if the record has next expected index
      if record.index == self.expected_index {
        // If the record has next expected index, write it immediately
        self.write_impl(&record)?;
        self.expected_index += 1;
      } else {
        // If the record has an unexpected index, queue it to write later
        self.queue.insert(record.index, record);
      }

      // Periodically try to write the queued records
      self.write_queued_records()?;
    }
    Ok(())
  }
/// Writes a record.
///
/// In in-order mode, if one or more of the preceding records has not been written yet (according to the record index
/// derived from order of records in the input files) then the current record is queued to be written at a later time.
/// This ensures that the records in output files are in the same order as in the input files.
///
/// In out-of-order mode, records are written as they come from worker threads. In this case the order in output files
/// is not defined (due to differences in processing times between items, and thread scheduling between runs)
Writes a record.
In in-order mode, if one or more of the preceding records has not been written yet (according to the record index
derived from order of records in the input files) then the current record is queued to be written at a later time.
This ensures that the records in output files are in the same order as in the input files.

In out-of-order mode, records are written as they come from worker threads. In this case the order in output files
is not defined (due to differences in processing times between items, and thread scheduling between runs)
Writes a record . In in - order mode if one or more of the preceding records has not been written yet ( according to the record index derived from order of records in the input files ) then the current record is queued to be written at a later time . This ensures that the records in output files are in the same order as in the input files . In out - of - order mode records are written as they come from worker threads . In this case the order in output files is not defined ( due to differences in processing times between items and thread scheduling between runs )
pub fn write_record(&mut self, record: NextalignRecord) -> Result<(), Report> {
    if !self.in_order {
      // Out-of-order mode: write immediately
      self.write_impl(&record)?;
    } else {
      // In-order mode: check if the record has next expected index
      if record.index == self.expected_index {
        // If the record has next expected index, write it immediately
        self.write_impl(&record)?;
        self.expected_index += 1;
      } else {
        // If the record has an unexpected index, queue it to write later
        self.queue.insert(record.index, record);
      }
      // Periodically try to write the queued records
      self.write_queued_records()?;
    }
    Ok(())
  }
pub fn write_record ( & mut self , record : NextalignRecord ) -> Result < ( ) , Report > { if ! self . in_order { // Out-of-order mode: write immediately self . write_impl ( & record ) ? ; } else { // In-order mode: check if the record has next expected index if record . index == self . expected_index { // If the record has next expected index, write it immediately self . write_impl ( & record ) ? ; self . expected_index += 1 ; } else { // If the record has an unexpected index, queue it to write later self . queue . insert ( record . index , record ) ; } // Periodically try to write the queued records self . write_queued_records ( ) ? ; } Ok ( ( ) ) }
Writes a record.
Writes a record .
&mut self
record
NextalignRecord
&mut self
record
NextalignRecord