Struct gix_diff::blob::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§
source§impl<'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>) -> 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>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
) -> 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>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
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
.