pub struct Stats {
pub directories_deleted: AtomicUsize,
pub files_deleted: AtomicUsize,
pub bytes_freed: AtomicU64,
pub errors: AtomicUsize,
}Expand description
Thread-safe statistics using atomic operations Uses Relaxed ordering for maximum performance since we only need eventual consistency
Fields§
§directories_deleted: AtomicUsize§files_deleted: AtomicUsize§bytes_freed: AtomicU64§errors: AtomicUsizeImplementations§
Source§impl Stats
impl Stats
pub fn new() -> Self
pub fn add_directories(&self, count: usize)
pub fn add_files(&self, count: usize)
pub fn add_bytes(&self, bytes: u64)
pub fn add_errors(&self, count: usize)
pub fn add_batch( &self, directories: usize, files: usize, bytes: u64, errors: usize, )
pub fn directories(&self) -> usize
pub fn files(&self) -> usize
pub fn bytes(&self) -> u64
pub fn error_count(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Stats
impl RefUnwindSafe for Stats
impl Send for Stats
impl Sync for Stats
impl Unpin for Stats
impl UnsafeUnpin for Stats
impl UnwindSafe for Stats
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