pub struct Diff {
pub hunks: Vec<ChangedHunk>,
}Expand description
A parsed unified diff.
Fields§
§hunks: Vec<ChangedHunk>All hunks across all files.
Implementations§
Source§impl Diff
impl Diff
Sourcepub fn added_lines(&self) -> impl Iterator<Item = (&str, &AddedLine)>
pub fn added_lines(&self) -> impl Iterator<Item = (&str, &AddedLine)>
Iterate over all added lines across all hunks, paired with their file path.
Sourcepub fn removed_lines(&self) -> impl Iterator<Item = (&str, &str)>
pub fn removed_lines(&self) -> impl Iterator<Item = (&str, &str)>
Iterate over all removed lines across all hunks, paired with their file path.
Trait Implementations§
impl Eq for Diff
impl StructuralPartialEq for Diff
Auto Trait Implementations§
impl Forget for Diff
impl Freeze for Diff
impl Move for Diff
impl RefUnwindSafe for Diff
impl Send for Diff
impl Sync for Diff
impl Unpin for Diff
impl UnsafeUnpin for Diff
impl UnwindSafe for Diff
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