Struct similar::algorithms::Compact [−][src]
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
impl<'old, 'new, Old: ?Sized, New: ?Sized, D> Compact<'old, 'new, Old, New, D> where
D: DiffHook,
Old: Index<usize> + 'old,
New: Index<usize> + 'new,
New::Output: PartialEq<Old::Output>, [src]
D: DiffHook,
Old: Index<usize> + 'old,
New: Index<usize> + 'new,
New::Output: PartialEq<Old::Output>,
pub fn new(d: D, old: &'old Old, new: &'new New) -> Self[src]
Creates a new compact hook wrapping another hook.
pub fn into_inner(self) -> D[src]
Extracts the inner hook.
Trait Implementations
impl<'old, 'new, Old: ?Sized, New: ?Sized, D: DiffHook> AsMut<D> for Compact<'old, 'new, Old, New, D>[src]
impl<'old, 'new, Old: ?Sized, New: ?Sized, D: DiffHook> AsRef<D> for Compact<'old, 'new, Old, New, D>[src]
impl<'old, 'new, Old: Debug + ?Sized, New: Debug + ?Sized, D: Debug> Debug for Compact<'old, 'new, Old, New, D>[src]
impl<'old, 'new, Old: ?Sized, New: ?Sized, D> DiffHook for Compact<'old, 'new, Old, New, D> where
D: DiffHook,
Old: Index<usize> + 'old,
New: Index<usize> + 'new,
New::Output: PartialEq<Old::Output>, [src]
D: DiffHook,
Old: Index<usize> + 'old,
New: Index<usize> + 'new,
New::Output: PartialEq<Old::Output>,
type Error = D::Error
The error produced from the hook methods.
fn equal(
&mut self,
old_index: usize,
new_index: usize,
len: usize
) -> Result<(), Self::Error>[src]
&mut self,
old_index: usize,
new_index: usize,
len: usize
) -> Result<(), Self::Error>
fn delete(
&mut self,
old_index: usize,
old_len: usize,
new_index: usize
) -> Result<(), Self::Error>[src]
&mut self,
old_index: usize,
old_len: usize,
new_index: usize
) -> Result<(), Self::Error>
fn insert(
&mut self,
old_index: usize,
new_index: usize,
new_len: usize
) -> Result<(), Self::Error>[src]
&mut self,
old_index: usize,
new_index: usize,
new_len: usize
) -> Result<(), Self::Error>
fn finish(&mut self) -> Result<(), Self::Error>[src]
fn replace(
&mut self,
old_index: usize,
old_len: usize,
new_index: usize,
new_len: usize
) -> Result<(), Self::Error>[src]
&mut self,
old_index: usize,
old_len: usize,
new_index: usize,
new_len: usize
) -> Result<(), Self::Error>
Auto Trait Implementations
impl<'old, 'new, Old: ?Sized, New: ?Sized, D> RefUnwindSafe for Compact<'old, 'new, Old, New, D> where
D: RefUnwindSafe,
New: RefUnwindSafe,
Old: RefUnwindSafe,
D: RefUnwindSafe,
New: RefUnwindSafe,
Old: RefUnwindSafe,
impl<'old, 'new, Old: ?Sized, New: ?Sized, D> Send for Compact<'old, 'new, Old, New, D> where
D: Send,
New: Sync,
Old: Sync,
D: Send,
New: Sync,
Old: Sync,
impl<'old, 'new, Old: ?Sized, New: ?Sized, D> Sync for Compact<'old, 'new, Old, New, D> where
D: Sync,
New: Sync,
Old: Sync,
D: Sync,
New: Sync,
Old: Sync,
impl<'old, 'new, Old: ?Sized, New: ?Sized, D> Unpin for Compact<'old, 'new, Old, New, D> where
D: Unpin,
D: Unpin,
impl<'old, 'new, Old: ?Sized, New: ?Sized, D> UnwindSafe for Compact<'old, 'new, Old, New, D> where
D: UnwindSafe,
New: RefUnwindSafe,
Old: RefUnwindSafe,
D: UnwindSafe,
New: RefUnwindSafe,
Old: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,