extract_archive_with_progress

Function extract_archive_with_progress 

Source
pub fn extract_archive_with_progress<P: AsRef<Path>, Q: AsRef<Path>>(
    archive_path: P,
    output_dir: Q,
    config: &SecurityConfig,
    _progress: &mut dyn ProgressCallback,
) -> Result<ExtractionReport>
Expand description

Extracts an archive with progress reporting.

Same as extract_archive but accepts a ProgressCallback for real-time progress updates during extraction.

§Arguments

  • archive_path - Path to the archive file
  • output_dir - Directory where files will be extracted
  • config - Security configuration for the extraction
  • progress - Callback for progress updates

§Errors

Returns an error if:

  • Archive file cannot be opened
  • Archive format is unsupported
  • Security validation fails
  • I/O operations fail

§Examples

use exarch_core::NoopProgress;
use exarch_core::SecurityConfig;
use exarch_core::extract_archive_with_progress;

let config = SecurityConfig::default();
let mut progress = NoopProgress;
let report =
    extract_archive_with_progress("archive.tar.gz", "/tmp/output", &config, &mut progress)?;
println!("Extracted {} files", report.files_extracted);