create_archive_with_progress

Function create_archive_with_progress 

Source
pub fn create_archive_with_progress<P: AsRef<Path>, Q: AsRef<Path>>(
    output_path: P,
    sources: &[Q],
    config: &CreationConfig,
    progress: &mut dyn ProgressCallback,
) -> Result<CreationReport>
Expand description

Creates an archive with progress reporting.

Same as create_archive but accepts a ProgressCallback for real-time progress updates during creation.

§Arguments

  • output_path - Path to the output archive file
  • sources - Source files and directories to include
  • config - Creation configuration
  • progress - Callback for progress updates

§Errors

Returns an error if:

  • Cannot determine archive format
  • Source files don’t exist
  • I/O operations fail
  • Configuration is invalid

§Examples

use exarch_core::NoopProgress;
use exarch_core::create_archive_with_progress;
use exarch_core::creation::CreationConfig;

let config = CreationConfig::default();
let mut progress = NoopProgress;
let report = create_archive_with_progress(
    "output.tar.gz",
    &["src/", "Cargo.toml"],
    &config,
    &mut progress,
)?;
println!("Created archive with {} files", report.files_added);