#[non_exhaustive]pub struct Hunk {
pub old_start: usize,
pub old_lines: usize,
pub new_start: usize,
pub new_lines: usize,
pub section: String,
pub lines: Vec<DiffLine>,
}Expand description
A single @@ … @@ hunk within a FileDiff.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.old_start: usizeStart line in the old file (the -<start> of the @@ header).
old_lines: usizeLine count in the old file (defaults to 1 when the ,<count> is omitted).
new_start: usizeStart line in the new file (the +<start> of the @@ header).
new_lines: usizeLine count in the new file (defaults to 1 when the ,<count> is omitted).
section: StringText after the closing @@ (the function/section heading); empty when none.
lines: Vec<DiffLine>The hunk body, one entry per +/-/ line.
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