pub struct HunkHeader {
pub old_line_no: u32,
pub old_size: u32,
pub new_line_no: u32,
pub new_size: u32,
pub text: Vec<u8>,
}
Expand description
Meta data which precedes a Hunk
s content.
For example: @@ -24,8 +24,6 @@ use radicle_surf::diff::*;
Fields§
§old_line_no: u32
Line the hunk started in the old file.
old_size: u32
Number of removed and context lines.
new_line_no: u32
Line the hunk started in the new file.
new_size: u32
Number of added and context lines.
text: Vec<u8>
Trailing text for the Hunk Header.
From Git’s documentation “Hunk headers mention the name of the function to which the hunk applies. See “Defining a custom hunk-header” in gitattributes for details of how to tailor to this to specific languages.“. It is likely best to leave this empty when generating diffs.
Implementations§
Source§impl HunkHeader
impl HunkHeader
pub fn old_line_range(&self) -> Range<u32>
pub fn new_line_range(&self) -> Range<u32>
Trait Implementations§
Source§impl Clone for HunkHeader
impl Clone for HunkHeader
Source§fn clone(&self) -> HunkHeader
fn clone(&self) -> HunkHeader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for HunkHeader
impl Debug for HunkHeader
Source§impl Decode for HunkHeader
impl Decode for HunkHeader
Source§impl Default for HunkHeader
impl Default for HunkHeader
Source§fn default() -> HunkHeader
fn default() -> HunkHeader
Returns the “default value” for a type. Read more
Source§impl Encode for HunkHeader
impl Encode for HunkHeader
Source§impl PartialEq for HunkHeader
impl PartialEq for HunkHeader
Source§impl ToPretty for HunkHeader
impl ToPretty for HunkHeader
Source§impl TryFrom<&Hunk<Modification>> for HunkHeader
impl TryFrom<&Hunk<Modification>> for HunkHeader
impl StructuralPartialEq for HunkHeader
Auto Trait Implementations§
impl Freeze for HunkHeader
impl RefUnwindSafe for HunkHeader
impl Send for HunkHeader
impl Sync for HunkHeader
impl Unpin for HunkHeader
impl UnwindSafe for HunkHeader
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