pub struct Hunk {
pub old_start: u32,
pub old_count: u32,
pub new_start: u32,
pub new_count: u32,
pub lines: Vec<DiffLine>,
}Expand description
A single @@-delimited hunk inside one file’s diff. lines
preserves the original unified-diff ordering with each line
tagged as context, added, or removed - the renderer iterates
them directly to draw the + / - / markers and per-side line
numbers without re-classifying anything.
Fields§
§old_start: u32§old_count: u32§new_start: u32§new_count: u32§lines: Vec<DiffLine>Implementations§
Source§impl Hunk
impl Hunk
Sourcepub fn added_count(&self) -> u32
pub fn added_count(&self) -> u32
Count of lines added in this hunk (+ markers).
Sourcepub fn removed_count(&self) -> u32
pub fn removed_count(&self) -> u32
Count of lines removed in this hunk (- markers).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Hunk
impl<'de> Deserialize<'de> for Hunk
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.