Struct similar::TextDiffConfig[][src]

pub struct TextDiffConfig { /* fields omitted */ }

A builder type config for more complex uses of TextDiff.

Requires the text feature.

Implementations

impl TextDiffConfig[src]

pub fn algorithm(&mut self, alg: Algorithm) -> &mut Self[src]

Changes the algorithm.

The default algorithm is Algorithm::Myers.

pub fn newline_terminated(&mut self, yes: bool) -> &mut Self[src]

Changes the newline termination flag.

The default is automatic based on input. This flag controls the behavior of TextDiff::iter_changes and unified diff generation with regards to newlines. When the flag is set to false (which is the default) then newlines are added. Otherwise the newlines from the source sequences are reused.

pub fn diff_lines<'old, 'new, 'bufs, T: DiffableStrRef + ?Sized>(
    &self,
    old: &'old T,
    new: &'new T
) -> TextDiff<'old, 'new, 'bufs, T::Output>
[src]

Creates a diff of lines.

This splits the text old and new into lines preserving newlines in the input.

pub fn diff_words<'old, 'new, 'bufs, T: DiffableStrRef + ?Sized>(
    &self,
    old: &'old T,
    new: &'new T
) -> TextDiff<'old, 'new, 'bufs, T::Output>
[src]

Creates a diff of words.

This splits the text into words and whitespace.

pub fn diff_chars<'old, 'new, 'bufs, T: DiffableStrRef + ?Sized>(
    &self,
    old: &'old T,
    new: &'new T
) -> TextDiff<'old, 'new, 'bufs, T::Output>
[src]

Creates a diff of characters.

pub fn diff_unicode_words<'old, 'new, 'bufs, T: DiffableStrRef + ?Sized>(
    &self,
    old: &'old T,
    new: &'new T
) -> TextDiff<'old, 'new, 'bufs, T::Output>
[src]

Creates a diff of unicode words.

This splits the text into words according to unicode rules. This is generally recommended over TextDiffConfig::diff_words but requires a dependency.

This requires the unicode feature.

pub fn diff_graphemes<'old, 'new, 'bufs, T: DiffableStrRef + ?Sized>(
    &self,
    old: &'old T,
    new: &'new T
) -> TextDiff<'old, 'new, 'bufs, T::Output>
[src]

Creates a diff of graphemes.

This requires the unicode feature.

pub fn diff_slices<'old, 'new, 'bufs, T: DiffableStr + ?Sized>(
    &self,
    old: &'bufs [&'old T],
    new: &'bufs [&'new T]
) -> TextDiff<'old, 'new, 'bufs, T>
[src]

Creates a diff of arbitrary slices.

Trait Implementations

impl Clone for TextDiffConfig[src]

impl Debug for TextDiffConfig[src]

impl Default for TextDiffConfig[src]

Auto Trait Implementations

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.