pub struct CleanProgress {
pub total_items: AtomicUsize,
pub completed_items: AtomicUsize,
pub bytes_cleaned: AtomicU64,
pub bytes_failed: AtomicU64,
pub current_item: Mutex<String>,
pub errors: Mutex<Vec<CleanError>>,
pub is_complete: AtomicBool,
pub is_cancelled: AtomicBool,
}Expand description
Progress tracking for clean operations
Fields§
§total_items: AtomicUsizeTotal items to clean
completed_items: AtomicUsizeItems completed
bytes_cleaned: AtomicU64Bytes cleaned so far
bytes_failed: AtomicU64Bytes that failed to clean
current_item: Mutex<String>Currently cleaning item
errors: Mutex<Vec<CleanError>>Errors encountered
is_complete: AtomicBoolWhether operation is complete
is_cancelled: AtomicBoolWhether operation was cancelled
Implementations§
Source§impl CleanProgress
impl CleanProgress
Sourcepub fn complete_item(&self, bytes: u64)
pub fn complete_item(&self, bytes: u64)
Mark an item as completed
Sourcepub fn fail_item(&self, bytes: u64, error: CleanError)
pub fn fail_item(&self, bytes: u64, error: CleanError)
Mark an item as failed
Sourcepub fn set_current(&self, item: impl Into<String>)
pub fn set_current(&self, item: impl Into<String>)
Set current item being cleaned
Sourcepub fn percentage(&self) -> f32
pub fn percentage(&self) -> f32
Get completion percentage
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Check if cancelled
Sourcepub fn mark_complete(&self)
pub fn mark_complete(&self)
Mark as complete
Sourcepub fn snapshot(&self) -> CleanProgressSnapshot
pub fn snapshot(&self) -> CleanProgressSnapshot
Get snapshot
Trait Implementations§
Source§impl Debug for CleanProgress
impl Debug for CleanProgress
Source§impl Default for CleanProgress
impl Default for CleanProgress
Source§fn default() -> CleanProgress
fn default() -> CleanProgress
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for CleanProgress
impl !RefUnwindSafe for CleanProgress
impl Send for CleanProgress
impl Sync for CleanProgress
impl Unpin for CleanProgress
impl UnwindSafe for CleanProgress
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