pub enum DirectoryMoveAllowedStrategies {
OnlyRename,
OnlyCopyAndDelete {
options: DirectoryMoveByCopyOptions,
},
Either {
copy_and_delete_options: DirectoryMoveByCopyOptions,
},
}Expand description
Describes the allowed strategies for moving a directory.
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: DirectoryMoveOptions and move_directory.
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: DirectoryMoveByCopyOptionsOptions 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: DirectoryMoveByCopyOptionsOptions for the copy-and-delete strategy.
Trait Implementations§
Source§impl Default for DirectoryMoveAllowedStrategies
impl Default for DirectoryMoveAllowedStrategies
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 DirectoryMoveByCopyOptions::default.