pub struct Differ { /* private fields */ }Expand description
The base Differ struct that orchestrates the diffing process
Implementations§
Source§impl Differ
impl Differ
Sourcepub fn new(old: &str, new: &str) -> Self
pub fn new(old: &str, new: &str) -> Self
Create a new Differ with the old and new content using the default algorithm (XDiff).
Sourcepub fn new_with_algorithm(
old: &str,
new: &str,
algorithm: DiffAlgorithmType,
) -> Self
pub fn new_with_algorithm( old: &str, new: &str, algorithm: DiffAlgorithmType, ) -> Self
Create a new Differ with the old and new content and a specified algorithm.
Sourcepub fn context_lines(self, lines: usize) -> Self
pub fn context_lines(self, lines: usize) -> Self
Set the number of context lines to include in the generated patch.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Differ
impl RefUnwindSafe for Differ
impl Send for Differ
impl Sync for Differ
impl Unpin for Differ
impl UnwindSafe for Differ
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