pub struct TextDiff<'a> {
pub left: &'a str,
pub right: &'a str,
}Expand description
A differencer for source texts, reporting character-level differences.
Fields§
§left: &'a strLeft text
right: &'a strRight text
Implementations§
Source§impl<'a> TextDiff<'a>
impl<'a> TextDiff<'a>
Sourcepub fn is_identical(&self) -> bool
pub fn is_identical(&self) -> bool
Returns true if left and right are identical.
Sourcepub fn char_diff_count(&self) -> usize
pub fn char_diff_count(&self) -> usize
Returns the number of differing characters.
Sourcepub fn format_diff(&self) -> String
pub fn format_diff(&self) -> String
Format a unified diff (simplified).
Auto Trait Implementations§
impl<'a> Freeze for TextDiff<'a>
impl<'a> RefUnwindSafe for TextDiff<'a>
impl<'a> Send for TextDiff<'a>
impl<'a> Sync for TextDiff<'a>
impl<'a> Unpin for TextDiff<'a>
impl<'a> UnsafeUnpin for TextDiff<'a>
impl<'a> UnwindSafe for TextDiff<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more