pub struct HunkHeader {
pub old_line_no: u32,
pub old_size: u32,
pub new_line_no: u32,
pub new_size: u32,
pub text: String,
}Expand description
Metadata from a unified diff hunk header.
Example: @@ -24,8 +24,6 @@ fn main.
Fields§
§old_line_no: u32Starting line number on the old side of the diff.
old_size: u32Number of old-side lines covered by the hunk.
new_line_no: u32Starting line number on the new side of the diff.
new_size: u32Number of new-side lines covered by the hunk.
text: StringOptional trailing hunk context text.
Implementations§
Trait Implementations§
Source§impl Clone for HunkHeader
impl Clone for HunkHeader
Source§impl Debug for HunkHeader
impl Debug for HunkHeader
Source§impl Decode for HunkHeader
impl Decode for HunkHeader
Source§fn decode(input: &mut impl BufRead) -> Result<Self, DecodeError>
fn decode(input: &mut impl BufRead) -> Result<Self, DecodeError>
Reads a hunk header line from the input stream.
Source§fn try_decode(input: &mut impl BufRead) -> Result<Option<Self>, DecodeError>
fn try_decode(input: &mut impl BufRead) -> Result<Option<Self>, DecodeError>
Reads and decodes a value, returning
Ok(None) at clean end-of-input.
Anything else, including a partial value followed by EOF surfaces as
Err.Source§fn decode_str(input: &str) -> Result<Self, DecodeError>
fn decode_str(input: &str) -> Result<Self, DecodeError>
Decodes a value from a UTF-8 string.
Source§fn decode_bytes(input: &[u8]) -> Result<Self, DecodeError>
fn decode_bytes(input: &[u8]) -> Result<Self, DecodeError>
Decodes a value from raw UTF-8 bytes.
Source§impl Default for HunkHeader
impl Default for HunkHeader
Source§impl Encode for HunkHeader
impl Encode for HunkHeader
impl Eq for HunkHeader
Source§impl PartialEq for HunkHeader
impl PartialEq 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 UnsafeUnpin 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