#[non_exhaustive]pub enum PatchError {
Unrecognised {
line_number: usize,
line: String,
},
MalformedHunk {
line_number: usize,
header: String,
},
Truncated {
line_number: usize,
},
Ambiguous {
line_number: usize,
line: String,
},
}Expand description
The patch could not be understood, so no scope claim can be made about it.
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.
Unrecognised
A line this parser does not recognise.
A refusal, not something to skip. That line might be the one introducing the file that should not have been touched.
MalformedHunk
A hunk header that does not state usable line counts.
Truncated
The patch ends part way through a hunk.
Ambiguous
A header whose paths cannot be read unambiguously.
Trait Implementations§
Source§impl Clone for PatchError
impl Clone for PatchError
Source§impl Debug for PatchError
impl Debug for PatchError
Source§impl Display for PatchError
impl Display for PatchError
impl Eq for PatchError
Source§impl Error for PatchError
impl Error for PatchError
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 PartialEq for PatchError
impl PartialEq for PatchError
impl StructuralPartialEq for PatchError
Auto Trait Implementations§
impl Freeze for PatchError
impl RefUnwindSafe for PatchError
impl Send for PatchError
impl Sync for PatchError
impl Unpin for PatchError
impl UnsafeUnpin 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