pub enum FileError {
SourceFileNotFound {
path: PathBuf,
},
SourcePathNotAFile {
path: PathBuf,
},
UnableToAccessSourceFile {
path: PathBuf,
error: Error,
},
DestinationPathAlreadyExists {
path: PathBuf,
},
UnableToAccessDestinationFile {
path: PathBuf,
error: Error,
},
SourceAndDestinationAreTheSame {
path: PathBuf,
},
OtherIoError {
error: Error,
},
}Expand description
An error that can occur when copying or moving a file.
Variants§
SourceFileNotFound
The provided source file path does not exist.
SourcePathNotAFile
The provided source file path exists, but is not a file.
UnableToAccessSourceFile
The source file cannot be accessed or canonicalized, for example due to missing permissions.
The inner std::io::Error will likely describe the real cause of this error.
Fields
DestinationPathAlreadyExists
The destination file already exists.
Certain file copy and move options can disable this error:
UnableToAccessDestinationFile
The destination file cannot be accessed, written to, or its path canonicalized, for example due to missing permissions.
The inner std::io::Error will likely describe the real cause of this error.
Fields
SourceAndDestinationAreTheSame
The source and destination file paths point to the same canonical file.
OtherIoError
Some other std::io::Error was encountered.
Trait Implementations§
Source§impl Error for FileError
impl Error for FileError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for FileError
impl !RefUnwindSafe for FileError
impl Send for FileError
impl Sync for FileError
impl Unpin for FileError
impl !UnwindSafe for FileError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more