Struct similar::text::TextDiffConfig [−][src]
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]
&self,
old: &'old str,
new: &'new str
) -> TextDiff<'old, 'new, 'bufs>
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]
&self,
old: &'old str,
new: &'new str
) -> TextDiff<'old, 'new, 'bufs>
Creates a diff of words.
pub fn diff_chars<'old, 'new, 'bufs>(
&self,
old: &'old str,
new: &'new str
) -> TextDiff<'old, 'new, 'bufs>
[src]
&self,
old: &'old str,
new: &'new str
) -> TextDiff<'old, 'new, 'bufs>
Creates a diff of characters.
pub fn diff_graphemes<'old, 'new, 'bufs>(
&self,
old: &'old str,
new: &'new str
) -> TextDiff<'old, 'new, 'bufs>
[src]
&self,
old: &'old str,
new: &'new str
) -> TextDiff<'old, 'new, 'bufs>
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]
&self,
old: &'bufs [&'old str],
new: &'bufs [&'new str]
) -> TextDiff<'old, 'new, 'bufs>
Creates a diff of arbitrary slices.
Trait Implementations
impl Clone for TextDiffConfig
[src]
fn clone(&self) -> TextDiffConfig
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for TextDiffConfig
[src]
impl Default for TextDiffConfig
[src]
fn default() -> TextDiffConfig
[src]
Auto Trait Implementations
impl RefUnwindSafe for TextDiffConfig
[src]
impl Send for TextDiffConfig
[src]
impl Sync for TextDiffConfig
[src]
impl Unpin for TextDiffConfig
[src]
impl UnwindSafe for TextDiffConfig
[src]
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,