pub struct InodeTracker { /* private fields */ }Expand description
Tracks seen inodes to prevent double-counting hardlinks.
When a file has multiple hardlinks, we only want to count its size once. This tracker uses a concurrent set to track (inode, device) pairs.
Implementations§
Source§impl InodeTracker
impl InodeTracker
Sourcepub fn track(&self, info: InodeInfo) -> bool
pub fn track(&self, info: InodeInfo) -> bool
Track an inode. Returns true if this is the first time seeing it.
If the inode was already tracked, returns false indicating this
is a hardlink to an already-counted file.
Trait Implementations§
Source§impl Debug for InodeTracker
impl Debug for InodeTracker
Source§impl Default for InodeTracker
impl Default for InodeTracker
Source§fn default() -> InodeTracker
fn default() -> InodeTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for InodeTracker
impl !RefUnwindSafe for InodeTracker
impl Send for InodeTracker
impl Sync for InodeTracker
impl Unpin for InodeTracker
impl UnwindSafe for InodeTracker
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