Struct similar::algorithms::Replace[][src]

pub struct Replace<D: DiffHook> { /* fields omitted */ }

A DiffHook that combines deletions and insertions to give blocks of maximal length, and replacements when appropriate.

It will replace DiffHook::insert and DiffHook::delete events when possible with DiffHook::replace events. Note that even though the text processing in the crate does not use replace events and always resolves then back to delete and insert, it's useful to always use the replacer to ensure a consistent order of inserts and deletes. This is why for instance the text diffing automatically uses this hook internally.

Implementations

impl<D: DiffHook> Replace<D>[src]

pub fn new(d: D) -> Self[src]

Creates a new replace hook wrapping another hook.

pub fn into_inner(self) -> D[src]

Extracts the inner hook.

Trait Implementations

impl<D: DiffHook> AsMut<D> for Replace<D>[src]

impl<D: DiffHook> AsRef<D> for Replace<D>[src]

impl<D: DiffHook> DiffHook for Replace<D>[src]

type Error = D::Error

Auto Trait Implementations

impl<D> RefUnwindSafe for Replace<D> where
    D: RefUnwindSafe
[src]

impl<D> Send for Replace<D> where
    D: Send
[src]

impl<D> Sync for Replace<D> where
    D: Sync
[src]

impl<D> Unpin for Replace<D> where
    D: Unpin
[src]

impl<D> UnwindSafe for Replace<D> where
    D: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.