pub struct Diff<'input> { /* private fields */ }
Expand description
Takes any number of inputs and finds regions that are them same between all of them.
Implementations§
source§impl<'input> Diff<'input>
impl<'input> Diff<'input>
pub fn for_tokenizer<T: AsRef<[u8]> + ?Sized + 'input>( inputs: impl IntoIterator<Item = &'input T>, tokenizer: impl Fn(&[u8]) -> Vec<Range<usize>>, ) -> Self
pub fn unrefined<T: AsRef<[u8]> + ?Sized + 'input>( inputs: impl IntoIterator<Item = &'input T>, ) -> Self
sourcepub fn by_line<T: AsRef<[u8]> + ?Sized + 'input>(
inputs: impl IntoIterator<Item = &'input T>,
) -> Self
pub fn by_line<T: AsRef<[u8]> + ?Sized + 'input>( inputs: impl IntoIterator<Item = &'input T>, ) -> Self
Compares inputs
line by line.
sourcepub fn by_word<T: AsRef<[u8]> + ?Sized + 'input>(
inputs: impl IntoIterator<Item = &'input T>,
) -> Self
pub fn by_word<T: AsRef<[u8]> + ?Sized + 'input>( inputs: impl IntoIterator<Item = &'input T>, ) -> Self
Compares inputs
word by word.
The inputs
is usually a changed hunk (e.g. a DiffHunk::Different
)
that was the output from a line-by-line diff.
pub fn hunks<'diff>(&'diff self) -> DiffHunkIterator<'diff, 'input> ⓘ
Trait Implementations§
Auto Trait Implementations§
impl<'input> Freeze for Diff<'input>
impl<'input> RefUnwindSafe for Diff<'input>
impl<'input> Send for Diff<'input>
impl<'input> Sync for Diff<'input>
impl<'input> Unpin for Diff<'input>
impl<'input> UnwindSafe for Diff<'input>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more