pub struct Hunk {
pub current_start: usize,
pub current_end: usize,
pub head_start: usize,
pub head_text: String,
}Expand description
A contiguous changed region between the committed text and the current buffer, for hunk navigation and revert.
Fields§
§current_start: usizeFirst current-buffer line (0-based) the hunk covers.
current_end: usizeOne past the last current line the hunk covers. Equal to current_start
for a pure deletion (nothing remains in the current buffer there).
head_start: usizeFirst HEAD line (0-based) the hunk’s committed text begins at — used to locate the region when staging the hunk into the index.
head_text: StringThe committed (HEAD) text for this region, with line endings, used to restore the hunk on revert. Empty for a pure addition.
Implementations§
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