pub struct Hunk {
pub old_start: usize,
pub old_len: usize,
pub new_start: usize,
pub new_len: usize,
pub lines: Vec<HunkLine>,
pub old_no_newline: bool,
pub new_no_newline: bool,
pub line_input_lines: Vec<usize>,
}Expand description
A single @@ -old_start,old_len +new_start,new_len @@ hunk.
old_start / new_start are 1-based line numbers as they appear in the
patch header. The *_no_newline flags record that the final line on that
side of the hunk is not terminated by a newline (the \ No newline at end of file marker).
Fields§
§old_start: usize§old_len: usize§new_start: usize§new_len: usize§lines: Vec<HunkLine>§old_no_newline: boolThe last context/deleted line of the old file lacks a trailing newline.
new_no_newline: boolThe last context/inserted line of the new file lacks a trailing newline.
line_input_lines: Vec<usize>The 1-based line number (in the patch input) of each entry in lines,
used by git apply’s whitespace-error reporting (git’s state->linenr).
Empty when the patch was not parsed from input (e.g. synthesised hunks).
Trait Implementations§
impl Eq for Hunk
impl StructuralPartialEq for Hunk
Auto Trait Implementations§
impl Freeze for Hunk
impl RefUnwindSafe for Hunk
impl Send for Hunk
impl Sync for Hunk
impl Unpin for Hunk
impl UnsafeUnpin for Hunk
impl UnwindSafe for Hunk
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