pub struct ProcessFileUseCase { /* private fields */ }Expand description
Use case for processing files through pipelines.
This is the core use case that orchestrates the entire file processing workflow, from loading the pipeline configuration through executing all stages and generating the output .adapipe file.
Implementations§
Source§impl ProcessFileUseCase
impl ProcessFileUseCase
Sourcepub fn new(
metrics_service: Arc<MetricsService>,
observability_service: Arc<ObservabilityService>,
pipeline_repository: Arc<SqlitePipelineRepository>,
) -> Self
pub fn new( metrics_service: Arc<MetricsService>, observability_service: Arc<ObservabilityService>, pipeline_repository: Arc<SqlitePipelineRepository>, ) -> Self
Creates a new Process File use case.
§Parameters
metrics_service- Metrics collection serviceobservability_service- Observability and health monitoringpipeline_repository- Repository for pipeline data access
Sourcepub async fn execute(&self, config: ProcessFileConfig) -> Result<()>
pub async fn execute(&self, config: ProcessFileConfig) -> Result<()>
Executes the process file use case.
Processes an input file through a configured pipeline, generating an
output .adapipe binary format file with comprehensive metadata.
§Parameters
config- Processing configuration (input, output, pipeline, options)
§Processing Steps
- Load Pipeline: Retrieve pipeline configuration from repository
- Determine Chunk Size: Adaptive or user-specified chunk size
- Determine Worker Count: Optimal parallelism for file size
- Create Services: Instantiate compression, encryption, I/O services
- Execute Pipeline: Process file through all configured stages
- Collect Metrics: Track performance at each stage
- Generate Output: Write .adapipe binary format with metadata
- Report Results: Display comprehensive processing summary
§Returns
Ok(())- File processed successfullyErr(anyhow::Error)- Processing failed
§Errors
Returns errors for:
- Input file not found or unreadable
- Pipeline not found in repository
- Processing stage failures
- Output file write errors
- Insufficient permissions
Auto Trait Implementations§
impl Freeze for ProcessFileUseCase
impl !RefUnwindSafe for ProcessFileUseCase
impl Send for ProcessFileUseCase
impl Sync for ProcessFileUseCase
impl Unpin for ProcessFileUseCase
impl !UnwindSafe for ProcessFileUseCase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more