Struct imara_diff::sink::Counter
source · [−]Expand description
Fields
removals: u32
Total number of recorded inserted tokens
.
Computed by summing the lengths of the after
subsequences pass to process_change
.
insertions: u32
Total number of recorded inserted tokens
.
Computed by summing the lengths of the after
subsequences pass to process_change
.
wrapped: T
The 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
sourceimpl<S: Sink> Sink for Counter<S>
impl<S: Sink> Sink for Counter<S>
type Out = Counter<<S as Sink>::Out>
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<T> RefUnwindSafe for Counter<T>where
T: RefUnwindSafe,
impl<T> Send for Counter<T>where
T: Send,
impl<T> Sync for Counter<T>where
T: Sync,
impl<T> Unpin for Counter<T>where
T: Unpin,
impl<T> UnwindSafe for Counter<T>where
T: 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