Skip to main content

process_text_file_parallel

Function process_text_file_parallel 

Source
pub fn process_text_file_parallel<F>(
    path: &Path,
    max_file_size: u64,
    line_processor: F,
) -> Result<()>
where F: Fn(&str) + Sync,
Expand description

Read a text file in a parallel, line-by-line fashion

This processes lines in parallel using Rayon for faster processing of large text files.

§Arguments

  • path - Path to the file to read
  • max_file_size - Maximum allowed file size
  • line_processor - Function to process each line

§Returns

Result indicating success or failure

§Errors

Returns an error if the file cannot be read or exceeds the size limit