pub struct Hunk {
pub id: HunkId,
pub header: HunkHeader,
pub lines: Vec<DiffLine>,
}Expand description
A unified diff hunk and its body lines.
Fields§
§id: HunkIdStable hunk identifier.
header: HunkHeaderParsed hunk header.
lines: Vec<DiffLine>Lines contained in the hunk body.
Implementations§
Source§impl Hunk
impl Hunk
Sourcepub fn highlight_source(&self, side: DiffSide) -> HighlightSource
pub fn highlight_source(&self, side: DiffSide) -> HighlightSource
Builds contiguous source text for one hunk side.
Trait Implementations§
Source§impl Decode for Hunk
impl Decode for Hunk
Source§fn decode(input: &mut impl BufRead) -> Result<Self, DecodeError>
fn decode(input: &mut impl BufRead) -> Result<Self, DecodeError>
Reads a complete hunk 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.
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