Skip to main content

Crate worktree_setup_copy

Crate worktree_setup_copy 

Source
Expand description

Fast parallel file copying with progress tracking.

This crate provides efficient file and directory copying operations with:

  • Parallel directory enumeration using jwalk
  • Parallel file copying using rayon
  • Copy-on-write support via reflink-copy (APFS, Btrfs, ReFS)
  • Progress callbacks for UI integration
  • Fast file counting

§Example

use worktree_setup_copy::{copy_directory, CopyProgress, count_files};

// Count files first for progress bar
let total = count_files(source);

copy_directory(source, target, |progress: &CopyProgress| {
    println!("{}/{} files copied", progress.files_copied, progress.files_total);
})?;

Structs§

CopyProgress
Progress information for a copy operation.
ProgressTracker
Thread-safe progress tracker using atomics.

Enums§

CopyError
Errors that can occur during copy operations.
CopyResult
Result of a copy operation.

Functions§

copy_directory
Copy a directory with parallel enumeration and copying.
copy_file
Copy a single file with progress callback.
count_files
Count files in a path.
count_files_with_progress
Count files in a directory with progress callback.
overwrite_file
Copy a single file, overwriting if it exists.