pub struct PatchHunk {
pub old_start: usize,
pub old_len: usize,
pub new_start: usize,
pub new_len: usize,
pub section: String,
pub lines: Vec<PatchLine>,
}Expand description
A hunk: @@ -old_start,old_len +new_start,new_len @@ section.
Fields§
§old_start: usize§old_len: usize§new_start: usize§new_len: usize§section: StringThe text after the closing @@ (often a function name).
lines: Vec<PatchLine>Implementations§
Source§impl PatchHunk
impl PatchHunk
Sourcepub fn header(&self) -> String
pub fn header(&self) -> String
The @@ … @@ header, with the section text.
The numbers are written as the file gave them (-5,0, -5, -5,3),
with no arithmetic, so a hand-built hunk with absurd numbers still
formats. The section is raw input: sanitize it before printing it
yourself (PatchView does).
Trait Implementations§
impl Eq for PatchHunk
impl StructuralPartialEq for PatchHunk
Auto Trait Implementations§
impl Freeze for PatchHunk
impl RefUnwindSafe for PatchHunk
impl Send for PatchHunk
impl Sync for PatchHunk
impl Unpin for PatchHunk
impl UnsafeUnpin for PatchHunk
impl UnwindSafe for PatchHunk
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.