#[non_exhaustive]pub enum ApplyError {
Show 15 variants
CorruptPatch {
input: String,
line: usize,
},
ContextMismatch {
hunk_index: usize,
expected_line: usize,
},
HunksOverlap {
hunk_index: usize,
},
UnexpectedEof {
hunk_index: usize,
},
PathNotUtf8,
MissingFilename,
MalformedHeaderPath {
side: PatchSide,
path: String,
},
InvalidMode {
line: usize,
text: String,
},
InvalidHunkHeader {
header: String,
},
BinaryPatch(BinaryPatchError),
PatchFailed {
path: String,
line: usize,
},
Failed {
path: String,
message: String,
},
NotInIndex {
path: String,
},
BinaryDataMissing {
path: String,
},
Cancelled,
}Expand description
Unified diff / patch application errors.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CorruptPatch
Patch bytes are malformed at a known input location.
Fields
ContextMismatch
Preimage context could not be located in the blob at any search offset.
Fields
HunksOverlap
A later hunk would modify lines already changed by an earlier hunk.
UnexpectedEof
The patch removes more lines than exist in the blob (without a valid EOF match).
PathNotUtf8
A path named by the patch is not valid UTF-8.
MissingFilename
A traditional (non-git) patch header names no file that the strip level leaves.
MalformedHeaderPath
A diff --git header path has fewer leading components than the strip level removes.
Fields
InvalidMode
A mode header line (old mode, new file mode, …) carries no mode.
Fields
InvalidHunkHeader
A @@ -a,b +c,d @@ hunk header could not be parsed.
BinaryPatch(BinaryPatchError)
A GIT binary patch section is malformed or cannot be applied.
PatchFailed
A text hunk could not be matched or applied.
Failed
Index or blob apply failed for a path.
NotInIndex
--cached apply requires a stage-0 index entry at the preimage path.
BinaryDataMissing
A binary diff marker without GIT binary patch payload cannot be applied.
Cancelled
The caller’s crate::progress::CancelToken stopped the apply between files.
Trait Implementations§
Source§impl Clone for ApplyError
impl Clone for ApplyError
Source§impl Debug for ApplyError
impl Debug for ApplyError
Source§impl Display for ApplyError
impl Display for ApplyError
impl Eq for ApplyError
Source§impl Error for ApplyError
impl Error for ApplyError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<ApplyError> for CommitError
impl From<ApplyError> for CommitError
Source§fn from(source: ApplyError) -> Self
fn from(source: ApplyError) -> Self
Source§impl From<ApplyError> for HunkSelectError
impl From<ApplyError> for HunkSelectError
Source§fn from(source: ApplyError) -> Self
fn from(source: ApplyError) -> Self
Source§impl From<ApplyError> for StashError
impl From<ApplyError> for StashError
Source§fn from(source: ApplyError) -> Self
fn from(source: ApplyError) -> Self
Source§impl From<ApplyError> for DiffError
impl From<ApplyError> for DiffError
Source§fn from(source: ApplyError) -> Self
fn from(source: ApplyError) -> Self
Source§impl From<ApplyError> for Error
impl From<ApplyError> for Error
Source§fn from(err: ApplyError) -> Self
fn from(err: ApplyError) -> Self
Source§impl From<BinaryPatchError> for ApplyError
impl From<BinaryPatchError> for ApplyError
Source§fn from(source: BinaryPatchError) -> Self
fn from(source: BinaryPatchError) -> Self
Source§impl PartialEq for ApplyError
impl PartialEq for ApplyError
impl StructuralPartialEq for ApplyError
Auto Trait Implementations§
impl Forget for ApplyError
impl Freeze for ApplyError
impl RefUnwindSafe for ApplyError
impl Send for ApplyError
impl Sync for ApplyError
impl Unpin for ApplyError
impl UnsafeUnpin for ApplyError
impl UnwindSafe for ApplyError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.