#[non_exhaustive]pub enum ApplyError {
CorruptPatch {
input: String,
line: usize,
},
ContextMismatch {
hunk_index: usize,
expected_line: usize,
},
HunksOverlap {
hunk_index: usize,
},
UnexpectedEof {
hunk_index: usize,
},
Other(String),
PatchFailed {
path: String,
line: usize,
},
Failed {
path: String,
message: String,
},
NotInIndex {
path: String,
},
BinaryDataMissing {
path: String,
},
}Expand description
Unified diff / patch application errors.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
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).
Other(String)
Other apply parse failures.
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.
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
1.30.0 · 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()
Source§impl From<ApplyError> for CommitPatchError
impl From<ApplyError> for CommitPatchError
Source§fn from(source: ApplyError) -> Self
fn from(source: ApplyError) -> Self
Converts to this type from the input type.
Source§impl From<ApplyError> for HunkSelectError
impl From<ApplyError> for HunkSelectError
Source§fn from(source: ApplyError) -> Self
fn from(source: ApplyError) -> Self
Converts to this type from the input type.
Source§impl From<ApplyError> for Error
impl From<ApplyError> for Error
Source§fn from(source: ApplyError) -> Self
fn from(source: ApplyError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ApplyError
impl PartialEq for ApplyError
impl StructuralPartialEq for ApplyError
Auto Trait Implementations§
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
Mutably borrows from an owned value. Read more