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