Skip to content

Commit 101e838

Browse files
committed
Volume copy: serial path uses transfer driver
- `copy_volumes_with_progress`'s serial fallback (small-batch / `concurrency == 1`) now delegates the per-iter scaffolding (cancellation check, pre-skip, conflict detect + dispatch, skip accounting, paired progress emit) to `drive_transfer_serial_async` in `transfer_driver.rs`. The closure body is just `copy_single_path` plus per-task progress emit. - Concurrent path (`FuturesUnordered` sliding window) stays inline per plan § "Concurrent driver scope" option (a): only 1 of 4 ops needs it, so abstracting it would be a 1-of-4 abstraction with very different trait bounds (`Fn + Send + Sync` for `FuturesUnordered` vs serial's `FnMut`). - `build_pre_skip_set` from the driver replaces the inline bulk-skip set construction; the bulk-skip emit prelude runs only in the concurrent path (driver owns it for the serial path). - `source_hints` is plumbed through both the conflict resolver closure (for `source_size_hint` / `source_is_dir` lookup) and the transfer closure (for the SMB compound fast-path), wiring the cached scan hints into the driver-owned conflict-resolve path. `ConflictDecisionInput`'s `source_is_directory_hint` / `source_size_hint` driver fields remain `None` (the driver doesn't see the hints map); the closure does the lookup directly. - `WriteFailure`'s `volume_ctx` is preserved through the driver boundary via a `Mutex<Option<(VolumeError, PathBuf)>>` cell the transfer closure populates on error; the post-loop branch reconstructs the failure with full friendly-error context. - All 33 existing `volume_copy` tests pass without modification, including `test_pre_known_conflicts_bulk_skip_on_real_local_volumes`, `test_concurrent_copy_50_files_all_succeed`, and all cancel-mid-flight paths. Closure captures `events`, `operation_id`, and `config` are widened to `'static`-named locals (transmute on `events`, clone on the other two) so the closures satisfy the driver's `for<'a> FnMut(...) -> Pin<Box<dyn Future + Send + 'a>>` bound. Sound because the closures don't outlive the driver `.await`. Documented inline.
1 parent 118ac6b commit 101e838

1 file changed

Lines changed: 334 additions & 188 deletions

File tree

0 commit comments

Comments
 (0)