pub enum DirectoryMoveWithProgressAllowedStrategies {
OnlyRename,
OnlyCopyAndDelete {
options: DirectoryMoveWithProgressByCopyOptions,
},
Either {
copy_and_delete_options: DirectoryMoveWithProgressByCopyOptions,
},
}Expand description
Describes the allowed strategies for moving a directory (with progress tracking).
This ensures at least one of “rename” or “copy-and-delete” strategies are enabled at any point.
Unless you have a good reason for picking something else, Self::Either
is highly recommended. It ensures we always try to rename the directory if the
conditions are right, and fall back to the slower copy-and-delete strategy if that fails.
See also: DirectoryMoveWithProgressOptions and move_directory_with_progress.
Variants§
OnlyRename
Disables the move by copy-and-delete strategy, leaving only the rename strategy.
If renaming fails, for example due to source and destination being on different
mount points, the corresponding function will return
ExecutionError(RenameFailedAndNoFallbackStrategy).
OnlyCopyAndDelete
Disables the move by rename strategy, leaving only the less efficient, but more general, copy-and-delete strategy.
Fields
options: DirectoryMoveWithProgressByCopyOptionsOptions for the copy-and-delete strategy.
Either
Enables both the rename and copy-and-delete strategies, leaving the optimal choice in the hands of the library.
Generally speaking, a rename will be attempted under the right conditions, with the copy-and-delete performed as a fallback if the rename fails.
Fields
copy_and_delete_options: DirectoryMoveWithProgressByCopyOptionsOptions for the copy-and-delete strategy.
Trait Implementations§
Source§impl Default for DirectoryMoveWithProgressAllowedStrategies
impl Default for DirectoryMoveWithProgressAllowedStrategies
Source§fn default() -> Self
fn default() -> Self
Returns the default directory move strategy configuration, which is with both rename and copy-and-delete enabled.
For details on the default copy-and-delete options,
see DirectoryMoveWithProgressByCopyOptions::default.