Struct similar::text::TextDiffConfig[][src]

pub struct TextDiffConfig { /* fields omitted */ }

A builder type config for more complex uses of TextDiff.

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>(
    &self,
    old: &'old str,
    new: &'new str
) -> TextDiff<'old, 'new, 'bufs>
[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>(
    &self,
    old: &'old str,
    new: &'new str
) -> TextDiff<'old, 'new, 'bufs>
[src]

Creates a diff of words.

pub fn diff_chars<'old, 'new, 'bufs>(
    &self,
    old: &'old str,
    new: &'new str
) -> TextDiff<'old, 'new, 'bufs>
[src]

Creates a diff of characters.

pub fn diff_graphemes<'old, 'new, 'bufs>(
    &self,
    old: &'old str,
    new: &'new str
) -> TextDiff<'old, 'new, 'bufs>
[src]

Creates a diff of graphemes.

This requires the unicode feature.

pub fn diff_slices<'old, 'new, 'bufs>(
    &self,
    old: &'bufs [&'old str],
    new: &'bufs [&'new str]
) -> TextDiff<'old, 'new, 'bufs>
[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.