Skip to main content

copy_directory

Function copy_directory 

Source
pub fn copy_directory<F>(
    source: &Path,
    target: &Path,
    on_progress: F,
) -> Result<CopyResult, CopyError>
where F: Fn(&CopyProgress) + Sync,
Expand description

Copy a directory with parallel enumeration and copying.

Only copies if target directory doesn’t exist.

§Arguments

  • source - Source directory path
  • target - Target directory path
  • on_progress - Callback for progress updates (called periodically, not for every file)

§Errors

  • If enumeration fails
  • If any file copy fails (fail-fast behavior)