pub enum DestinationDirectoryPathValidationError {
NotADirectory {
directory_path: PathBuf,
},
UnableToAccess {
directory_path: PathBuf,
error: Error,
},
AlreadyExists {
path: PathBuf,
destination_directory_rule: DestinationDirectoryRule,
},
NotEmpty {
directory_path: PathBuf,
destination_directory_rule: DestinationDirectoryRule,
},
DescendantOfSourceDirectory {
destination_directory_path: PathBuf,
source_directory_path: PathBuf,
},
}Expand description
Destination directory path validation error.
Variants§
NotADirectory
The base source path (path to the directory you want to copy) exists, but does not point to a directory.
UnableToAccess
The destination directory could not be read, or its path could not be canonicalized.
Among other things, this can happen due to missing read permissions.
The inner std::io::Error will likely describe a more precise cause of this error.
Fields
AlreadyExists
A destination directory or a file inside it already exists,
which is against the provided DestinationDirectoryRule.
Fields
destination_directory_rule: DestinationDirectoryRuleDestination directory rule that made the existing destination
directory invalid (see DestinationDirectoryRule::DisallowExisting).
NotEmpty
A destination directory or a file inside it exists and is not empty,
which is against the provided DestinationDirectoryRule.
Fields
directory_path: PathBufPath to the destination directory that should be empty based on the provided rules.
destination_directory_rule: DestinationDirectoryRuleDestination directory rule that made the existing destination
directory invalid (see DestinationDirectoryRule::AllowEmpty).
DescendantOfSourceDirectory
The destination directory path equals or points inside the source directory, which is very problematic for copies or moves.