pub struct ProgressTracker<'a> { /* private fields */ }Expand description
Helper struct for tracking and emitting progress events from dedup algorithms.
Implementations§
Source§impl<'a> ProgressTracker<'a>
impl<'a> ProgressTracker<'a>
Sourcepub fn new(
reporter: &'a dyn ProgressReporter,
phase: &str,
total: usize,
) -> Self
pub fn new( reporter: &'a dyn ProgressReporter, phase: &str, total: usize, ) -> Self
Create a new tracker for a phase.
Sourcepub fn tick_batch(&mut self, batch_size: usize)
pub fn tick_batch(&mut self, batch_size: usize)
Report that a batch of items has been processed.
Sourcepub fn report_error(&self, item_id: &str, error: &str)
pub fn report_error(&self, item_id: &str, error: &str)
Report an error for an item.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Returns true if cancellation has been requested.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ProgressTracker<'a>
impl<'a> !UnwindSafe for ProgressTracker<'a>
impl<'a> Freeze for ProgressTracker<'a>
impl<'a> Send for ProgressTracker<'a>
impl<'a> Sync for ProgressTracker<'a>
impl<'a> Unpin for ProgressTracker<'a>
impl<'a> UnsafeUnpin for ProgressTracker<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more