Struct prettydiff::text::LineChangeset
source · [−]pub struct LineChangeset<'a> { /* private fields */ }Expand description
Container for line-by-line text diff result. Can be pretty-printed by Display trait.
Implementations
sourceimpl<'a> LineChangeset<'a>
impl<'a> LineChangeset<'a>
pub fn new(old: Vec<&'a str>, new: Vec<&'a str>) -> LineChangeset<'a>
sourcepub fn set_diff_only(self, val: bool) -> Self
pub fn set_diff_only(self, val: bool) -> Self
Show only differences for side-by-side diff
sourcepub fn set_show_lines(self, val: bool) -> Self
pub fn set_show_lines(self, val: bool) -> Self
Show lines in side-by-side diff
sourcepub fn set_trim_new_lines(self, val: bool) -> Self
pub fn set_trim_new_lines(self, val: bool) -> Self
Trim new lines in side-by-side diff
sourcepub fn set_align_new_lines(self, val: bool) -> Self
pub fn set_align_new_lines(self, val: bool) -> Self
Align new lines inside diff
sourcepub fn diff(&self) -> Vec<DiffOp<'a, &str>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn diff(&self) -> Vec<DiffOp<'a, &str>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns Vec of changes
sourcepub fn prettytable(&self)
pub fn prettytable(&self)
Prints side-by-side diff in table
pub fn format(&self) -> String
Trait Implementations
sourceimpl<'a> Debug for LineChangeset<'a>
impl<'a> Debug for LineChangeset<'a>
sourceimpl<'a> Display for LineChangeset<'a>
impl<'a> Display for LineChangeset<'a>
sourceimpl<'a> PartialEq<LineChangeset<'a>> for LineChangeset<'a>
impl<'a> PartialEq<LineChangeset<'a>> for LineChangeset<'a>
sourcefn eq(&self, other: &LineChangeset<'a>) -> bool
fn eq(&self, other: &LineChangeset<'a>) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &LineChangeset<'a>) -> bool
fn ne(&self, other: &LineChangeset<'a>) -> bool
This method tests for !=.
impl<'a> Eq for LineChangeset<'a>
impl<'a> StructuralEq for LineChangeset<'a>
impl<'a> StructuralPartialEq for LineChangeset<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for LineChangeset<'a>
impl<'a> Send for LineChangeset<'a>
impl<'a> Sync for LineChangeset<'a>
impl<'a> Unpin for LineChangeset<'a>
impl<'a> UnwindSafe for LineChangeset<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more