Struct git_repository::diff::blob::sink::Counter
pub struct Counter<T> {
pub removals: u32,
pub insertions: u32,
pub wrapped: T,
}Expand description
Fields§
§removals: u32Total number of recorded inserted tokens.
Computed by summing the lengths of the after subsequences pass to process_change.
insertions: u32Total number of recorded inserted tokens.
Computed by summing the lengths of the after subsequences pass to process_change.
wrapped: TThe Sink for which the counter records tokens.
All calls to process_change are forwarded to the sink by the counter.
After finish is called, this field contains the output returned by the finish
method of the wrapped Sink
Implementations§
Trait Implementations§
§impl<S> Sink for Counter<S>where
S: Sink,
impl<S> Sink for Counter<S>where S: Sink,
type Out = Counter<<S as Sink>::Out>
§fn finish(self) -> <Counter<S> as Sink>::Out
fn finish(self) -> <Counter<S> as Sink>::Out
This function is called after all calls to
process_change are complete
to obtain the final diff result§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.