Struct gix_diff::blob::UnifiedDiffBuilder
source · pub struct UnifiedDiffBuilder<'a, W, T>{ /* private fields */ }
Available on crate feature
blob
only.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§
source§impl<'a, T> UnifiedDiffBuilder<'a, String, T>
impl<'a, T> UnifiedDiffBuilder<'a, String, T>
sourcepub fn new(input: &'a InternedInput<T>) -> UnifiedDiffBuilder<'a, String, T>
pub fn new(input: &'a InternedInput<T>) -> UnifiedDiffBuilder<'a, String, T>
Create a new UnifiedDiffBuilder
for the given input
,
that will return a String
.
source§impl<'a, W, T> UnifiedDiffBuilder<'a, W, T>
impl<'a, W, T> UnifiedDiffBuilder<'a, W, T>
sourcepub fn with_writer(
input: &'a InternedInput<T>,
writer: W
) -> UnifiedDiffBuilder<'a, W, T>
pub fn with_writer( input: &'a InternedInput<T>, writer: W ) -> UnifiedDiffBuilder<'a, W, T>
Create a new UnifiedDiffBuilder
for the given input
,
that will writes it output to the provided implementation of Write
.
Trait Implementations§
source§impl<W, T> Sink for UnifiedDiffBuilder<'_, W, T>
impl<W, T> Sink for UnifiedDiffBuilder<'_, W, T>
type Out = W
source§fn finish(self) -> <UnifiedDiffBuilder<'_, W, T> as Sink>::Out
fn finish(self) -> <UnifiedDiffBuilder<'_, W, T> as Sink>::Out
This function is called after all calls to
process_change
are complete
to obtain the final diff resultsource§fn 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
.Auto 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>
impl<'a, W, T> Sync for UnifiedDiffBuilder<'a, W, T>
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§
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