pub struct Hunk {
pub header: HunkHeader,
pub lines: Vec<HunkLine>,
pub body: String,
}Expand description
Represents a hunk in a patch
Fields§
§header: HunkHeaderThe parsed header of the hunk
lines: Vec<HunkLine>Parsed lines of the hunk
body: StringThe original full hunk body
Implementations§
Source§impl Hunk
impl Hunk
Sourcepub fn insert_line_at(&mut self, line: HunkLine, index: usize)
pub fn insert_line_at(&mut self, line: HunkLine, index: usize)
Inserts a line at the given index on matchable lines. Converts the index to the actual underlying index
pub fn real_index(&self, index: usize) -> usize
pub fn matches(&self, line: &str, index: usize, log: bool) -> bool
pub fn render_updated(&self) -> Result<String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Hunk
impl RefUnwindSafe for Hunk
impl Send for Hunk
impl Sync for Hunk
impl Unpin 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