pub enum PatchError {
Io {
path: PathBuf,
source: Error,
},
PathTraversal(PathBuf),
TargetNotFound(PathBuf),
MissingFileHeader,
}
Expand description
Represents the possible errors that can occur during patch operations.
Variants§
Io
An I/O error occurred while reading or writing a file.
PathTraversal(PathBuf)
The patch attempted to access a path outside the target directory. This is a security measure to prevent malicious patches from modifying unintended files.
TargetNotFound(PathBuf)
The target file for a patch could not be found, and the patch was not a file creation patch.
MissingFileHeader
A ````diff block was found, but it was missing the
— a/path/to/file`
header required to identify the target file.
Trait Implementations§
Source§impl Debug for PatchError
impl Debug for PatchError
Source§impl Display for PatchError
impl Display for PatchError
Source§impl Error for PatchError
impl Error for PatchError
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 PatchError
impl !RefUnwindSafe for PatchError
impl Send for PatchError
impl Sync for PatchError
impl Unpin for PatchError
impl !UnwindSafe for PatchError
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