pub struct DiffLine<'a> {
pub content: &'a [u8],
pub has_newline: bool,
}Expand description
A single line of a blob, slicing into the original buffer.
content includes the line’s own trailing newline byte when present;
has_newline records whether this line ended with \n in the source. Only
the final line of a blob can have has_newline == false (a file with “no
newline at end of file”). Comparing two DiffLines for equality compares
both the bytes and the trailing-newline flag, so a line that gained or lost
its terminating newline is treated as a real change, matching git.
Fields§
§content: &'a [u8]The raw bytes of the line, including the trailing \n if it had one.
has_newline: boolWhether the line was terminated by a newline in the source blob.
Implementations§
Trait Implementations§
impl<'a> Copy for DiffLine<'a>
impl<'a> Eq for DiffLine<'a>
Source§impl<'a> PartialEq for DiffLine<'a>
impl<'a> PartialEq for DiffLine<'a>
impl<'a> StructuralPartialEq for DiffLine<'a>
Auto Trait Implementations§
impl<'a> Freeze for DiffLine<'a>
impl<'a> RefUnwindSafe for DiffLine<'a>
impl<'a> Send for DiffLine<'a>
impl<'a> Sync for DiffLine<'a>
impl<'a> Unpin for DiffLine<'a>
impl<'a> UnsafeUnpin for DiffLine<'a>
impl<'a> UnwindSafe for DiffLine<'a>
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