Struct similar::udiff::UnifiedDiffHunk
source · pub struct UnifiedDiffHunk<'diff, 'old, 'new, 'bufs, T: DiffableStr + ?Sized> { /* private fields */ }
Expand description
Unified diff hunk formatter.
The Display
this renders out a single unified diff’s hunk.
Implementations§
source§impl<'diff, 'old, 'new, 'bufs, T: DiffableStr + ?Sized> UnifiedDiffHunk<'diff, 'old, 'new, 'bufs, T>
impl<'diff, 'old, 'new, 'bufs, T: DiffableStr + ?Sized> UnifiedDiffHunk<'diff, 'old, 'new, 'bufs, T>
sourcepub fn new(
ops: Vec<DiffOp>,
diff: &'diff TextDiff<'old, 'new, 'bufs, T>,
missing_newline_hint: bool,
) -> UnifiedDiffHunk<'diff, 'old, 'new, 'bufs, T>
pub fn new( ops: Vec<DiffOp>, diff: &'diff TextDiff<'old, 'new, 'bufs, T>, missing_newline_hint: bool, ) -> UnifiedDiffHunk<'diff, 'old, 'new, 'bufs, T>
Creates a new hunk for some operations.
sourcepub fn header(&self) -> UnifiedHunkHeader
pub fn header(&self) -> UnifiedHunkHeader
Returns the header for the hunk.
sourcepub fn missing_newline_hint(&self) -> bool
pub fn missing_newline_hint(&self) -> bool
Returns the value of the missing_newline_hint
flag.
sourcepub fn iter_changes<'x, 'slf>(&'slf self) -> AllChangesIter<'slf, 'x, T> ⓘwhere
'x: 'slf + 'old + 'new,
'old: 'x,
'new: 'x,
pub fn iter_changes<'x, 'slf>(&'slf self) -> AllChangesIter<'slf, 'x, T> ⓘwhere
'x: 'slf + 'old + 'new,
'old: 'x,
'new: 'x,
Iterates over all changes in a hunk.
Trait Implementations§
Auto Trait Implementations§
impl<'diff, 'old, 'new, 'bufs, T> Freeze for UnifiedDiffHunk<'diff, 'old, 'new, 'bufs, T>where
T: ?Sized,
impl<'diff, 'old, 'new, 'bufs, T> RefUnwindSafe for UnifiedDiffHunk<'diff, 'old, 'new, 'bufs, T>where
T: RefUnwindSafe + ?Sized,
impl<'diff, 'old, 'new, 'bufs, T> Send for UnifiedDiffHunk<'diff, 'old, 'new, 'bufs, T>
impl<'diff, 'old, 'new, 'bufs, T> Sync for UnifiedDiffHunk<'diff, 'old, 'new, 'bufs, T>
impl<'diff, 'old, 'new, 'bufs, T> Unpin for UnifiedDiffHunk<'diff, 'old, 'new, 'bufs, T>where
T: ?Sized,
impl<'diff, 'old, 'new, 'bufs, T> UnwindSafe for UnifiedDiffHunk<'diff, 'old, 'new, 'bufs, T>where
T: RefUnwindSafe + ?Sized,
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