Struct imara_diff::UnifiedDiffBuilder
source · [−]pub struct UnifiedDiffBuilder<'a, W, T>where
W: Write,
T: Hash + Eq + Display,{ /* private fields */ }
Expand description
A Sink
that creates a textual diff
in the format typically output by git or gnu-diff if the -u
option is used
Implementations
sourceimpl<'a, T> UnifiedDiffBuilder<'a, String, T>where
T: Hash + Eq + Display,
impl<'a, T> UnifiedDiffBuilder<'a, String, T>where
T: Hash + Eq + Display,
sourcepub fn new(input: &'a InternedInput<T>) -> Self
pub fn new(input: &'a InternedInput<T>) -> Self
Create a new UnifiedDiffBuilder
for the given input
,
that will return a String
.
sourceimpl<'a, W, T> UnifiedDiffBuilder<'a, W, T>where
W: Write,
T: Hash + Eq + Display,
impl<'a, W, T> UnifiedDiffBuilder<'a, W, T>where
W: Write,
T: Hash + Eq + Display,
sourcepub fn with_writer(input: &'a InternedInput<T>, writer: W) -> Self
pub fn with_writer(input: &'a InternedInput<T>, writer: W) -> Self
Create a new UnifiedDiffBuilder
for the given input
,
that will writes it output to the provided implementation of Write
.
Trait Implementations
sourceimpl<W, T> Sink for UnifiedDiffBuilder<'_, W, T>where
W: Write,
T: Hash + Eq + Display,
impl<W, T> Sink for UnifiedDiffBuilder<'_, W, T>where
W: Write,
T: Hash + Eq + Display,
type Out = W
sourcefn finish(self) -> Self::Out
fn finish(self) -> Self::Out
This function is called after all calls to
process_change
are complete
to obtain the final diff result Read moresourcefn with_counter(self) -> Counter<Self>
fn with_counter(self) -> Counter<Self>
Utility method that constructs a
Counter
that tracks the total number
of inserted and removed tokens in the changes passed to process_change
. Read moreAuto Trait Implementations
impl<'a, W, T> RefUnwindSafe for UnifiedDiffBuilder<'a, W, T>where
T: RefUnwindSafe,
W: RefUnwindSafe,
impl<'a, W, T> Send for UnifiedDiffBuilder<'a, W, T>where
T: Sync,
W: Send,
impl<'a, W, T> Sync for UnifiedDiffBuilder<'a, W, T>where
T: Sync,
W: Sync,
impl<'a, W, T> Unpin for UnifiedDiffBuilder<'a, W, T>where
W: Unpin,
impl<'a, W, T> UnwindSafe for UnifiedDiffBuilder<'a, W, T>where
T: RefUnwindSafe,
W: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more