FileProcessorService

Trait FileProcessorService 

Source
pub trait FileProcessorService: Send + Sync {
    // Required methods
    fn process_file<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        input_path: &'life1 Path,
        output_path: Option<&'life2 Path>,
        processor: Box<dyn ChunkProcessor>,
    ) -> Pin<Box<dyn Future<Output = Result<FileProcessingResult, PipelineError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn process_files_batch<'life0, 'async_trait>(
        &'life0 self,
        file_pairs: Vec<(PathBuf, Option<PathBuf>)>,
        processor: Box<dyn ChunkProcessor>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<FileProcessingResult>, PipelineError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn process_file_in_place<'life0, 'life1, 'async_trait>(
        &'life0 self,
        file_path: &'life1 Path,
        processor: Box<dyn ChunkProcessor>,
    ) -> Pin<Box<dyn Future<Output = Result<FileProcessingResult, PipelineError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn validate_file_before_processing<'life0, 'life1, 'async_trait>(
        &'life0 self,
        file_path: &'life1 Path,
    ) -> Pin<Box<dyn Future<Output = Result<bool, PipelineError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_processing_stats(&self) -> FileProcessingStats;
    fn reset_processing_stats(&mut self);
    fn get_config(&self) -> FileProcessorConfig;
    fn update_config(&mut self, config: FileProcessorConfig);
}
Expand description

Trait for processing files with the pipeline system

Required Methods§

Source

fn process_file<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, input_path: &'life1 Path, output_path: Option<&'life2 Path>, processor: Box<dyn ChunkProcessor>, ) -> Pin<Box<dyn Future<Output = Result<FileProcessingResult, PipelineError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Processes a single file through the pipeline

Source

fn process_files_batch<'life0, 'async_trait>( &'life0 self, file_pairs: Vec<(PathBuf, Option<PathBuf>)>, processor: Box<dyn ChunkProcessor>, ) -> Pin<Box<dyn Future<Output = Result<Vec<FileProcessingResult>, PipelineError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Processes multiple files concurrently

Source

fn process_file_in_place<'life0, 'life1, 'async_trait>( &'life0 self, file_path: &'life1 Path, processor: Box<dyn ChunkProcessor>, ) -> Pin<Box<dyn Future<Output = Result<FileProcessingResult, PipelineError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Processes a file in-place (modifying the original)

Source

fn validate_file_before_processing<'life0, 'life1, 'async_trait>( &'life0 self, file_path: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<bool, PipelineError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Validates file integrity before processing

Source

fn get_processing_stats(&self) -> FileProcessingStats

Gets processing statistics

Source

fn reset_processing_stats(&mut self)

Resets processing statistics

Source

fn get_config(&self) -> FileProcessorConfig

Gets the current configuration

Source

fn update_config(&mut self, config: FileProcessorConfig)

Updates the configuration

Implementors§