pub struct DiffHunk {
pub old_start: u32,
pub new_start: u32,
pub lines: Vec<u8>,
}Expand description
A single contiguous range of changes within a diff.
Nested fields within a DiffHunk:
┌──────────┬───────────┬───────────┬────────────────────────────┐
│ Field ID │ Wire Type │ Name │ Description │
├──────────┼───────────┼───────────┼────────────────────────────┤
│ 1 │ Varint │ old_start │ Start line in old file │
│ 2 │ Varint │ new_start │ Start line in new file │
│ 3 │ Bytes │ lines │ Hunk content (unified fmt) │
└──────────┴───────────┴───────────┴────────────────────────────┘The lines field contains the hunk body in unified diff format:
lines prefixed with + (added), - (removed), or (context).
Fields§
§old_start: u32§new_start: u32§lines: Vec<u8>Trait Implementations§
impl Eq for DiffHunk
impl StructuralPartialEq for DiffHunk
Auto Trait Implementations§
impl Freeze for DiffHunk
impl RefUnwindSafe for DiffHunk
impl Send for DiffHunk
impl Sync for DiffHunk
impl Unpin for DiffHunk
impl UnsafeUnpin for DiffHunk
impl UnwindSafe for DiffHunk
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