pub struct DiffHunk {
pub start: usize,
pub remove_count: usize,
pub add_count: usize,
pub remove_lines: Vec<String>,
pub add_lines: Vec<String>,
pub old_range: (usize, usize),
pub new_range: (usize, usize),
pub content: String,
}Expand description
A single hunk in a unified diff
Represents a contiguous block of changes with context lines.
Fields§
§start: usizeStarting line number in the original file
remove_count: usizeNumber of lines to remove from the original file
add_count: usizeNumber of lines to add to the new file
remove_lines: Vec<String>Lines to remove (without the ‘-’ prefix)
add_lines: Vec<String>Lines to add (without the ‘+’ prefix)
old_range: (usize, usize)Original file line range: (start, count)
new_range: (usize, usize)New file line range: (start, count)
content: StringFull hunk content including header and context
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.