pub struct Compact<'old, 'new, Old: ?Sized, New: ?Sized, D> { /* private fields */ }
Expand description
Performs semantic cleanup operations on a diff.
This merges similar ops together but also tries to move hunks up and
down the diff with the desire to connect as many hunks as possible.
It still needs to be combined with Replace
to get actual replace diff ops out.
Implementations§
Trait Implementations§
Source§impl<'old, 'new, Old: ?Sized, New: ?Sized, D: DiffHook> AsMut<D> for Compact<'old, 'new, Old, New, D>
impl<'old, 'new, Old: ?Sized, New: ?Sized, D: DiffHook> AsMut<D> for Compact<'old, 'new, Old, New, D>
Source§impl<'old, 'new, Old: ?Sized, New: ?Sized, D: DiffHook> AsRef<D> for Compact<'old, 'new, Old, New, D>
impl<'old, 'new, Old: ?Sized, New: ?Sized, D: DiffHook> AsRef<D> for Compact<'old, 'new, Old, New, D>
Source§impl<'old, 'new, Old: Debug + ?Sized, New: Debug + ?Sized, D: Debug> Debug for Compact<'old, 'new, Old, New, D>
impl<'old, 'new, Old: Debug + ?Sized, New: Debug + ?Sized, D: Debug> Debug for Compact<'old, 'new, Old, New, D>
Source§impl<'old, 'new, Old, New, D> DiffHook for Compact<'old, 'new, Old, New, D>
impl<'old, 'new, Old, New, D> DiffHook for Compact<'old, 'new, Old, New, D>
Source§fn equal(
&mut self,
old_index: usize,
new_index: usize,
len: usize,
) -> Result<(), Self::Error>
fn equal( &mut self, old_index: usize, new_index: usize, len: usize, ) -> Result<(), Self::Error>
Called when lines with indices
old_index
(in the old version) and
new_index
(in the new version) start an section equal in both
versions, of length len
.Source§fn delete(
&mut self,
old_index: usize,
old_len: usize,
new_index: usize,
) -> Result<(), Self::Error>
fn delete( &mut self, old_index: usize, old_len: usize, new_index: usize, ) -> Result<(), Self::Error>
Called when a section of length
old_len
, starting at old_index
,
needs to be deleted from the old version.Source§fn insert(
&mut self,
old_index: usize,
new_index: usize,
new_len: usize,
) -> Result<(), Self::Error>
fn insert( &mut self, old_index: usize, new_index: usize, new_len: usize, ) -> Result<(), Self::Error>
Called when a section of the new version, of length
new_len
and starting at new_index
, needs to be inserted at position `old_index’.Source§fn replace(
&mut self,
old_index: usize,
old_len: usize,
new_index: usize,
new_len: usize,
) -> Result<(), Self::Error>
fn replace( &mut self, old_index: usize, old_len: usize, new_index: usize, new_len: usize, ) -> Result<(), Self::Error>
Called when a section of the old version, starting at index
old_index
and of length old_len
, needs to be replaced with a
section of length new_len
, starting at new_index
, of the new
version. Read moreAuto Trait Implementations§
impl<'old, 'new, Old, New, D> Freeze for Compact<'old, 'new, Old, New, D>
impl<'old, 'new, Old, New, D> RefUnwindSafe for Compact<'old, 'new, Old, New, D>
impl<'old, 'new, Old, New, D> Send for Compact<'old, 'new, Old, New, D>
impl<'old, 'new, Old, New, D> Sync for Compact<'old, 'new, Old, New, D>
impl<'old, 'new, Old, New, D> Unpin for Compact<'old, 'new, Old, New, D>
impl<'old, 'new, Old, New, D> UnwindSafe for Compact<'old, 'new, Old, New, D>
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