pub struct CacheReport {
pub manager: &'static str,
pub kind: &'static str,
pub path: PathBuf,
pub bytes: u64,
pub clear_command: String,
pub clear: Clear,
pub note: Option<&'static str>,
pub cap_gb: Option<u64>,
pub over_cap: bool,
pub dependents: Option<usize>,
pub extra_args: Vec<String>,
}Expand description
One cache directory that exists on this machine.
Fields§
§manager: &'static strThe package manager that owns it.
kind: &'static strWhich of that manager’s caches this is, when it keeps more than one.
path: PathBufWhere it actually is, as resolved on this machine.
bytes: u64Total size on disk.
clear_command: StringThe command that empties it, as a human would type it.
Owned rather than borrowed because one row’s command names a path: a pnpm store
on a volume of its own is emptied by pnpm store prune --store-dir <that store>,
and no fixed string can say which one.
clear: ClearHow devp caches clear empties it.
note: Option<&'static str>What the user gives up by running that command, when it is more than time.
cap_gb: Option<u64>The size cap set for this manager in cache_max_gb, in gibibytes.
None when none is set, which is the default and means this cache is never
called too big.
over_cap: boolWhether this manager’s caches add up to more than Self::cap_gb.
Per manager, not per row: cargo keeps a registry cache and an unpacked source tree, go keeps a build cache and a module cache, and “cargo is over ten gigabytes” is a statement about the pair. Every row of an over-cap manager is marked, because clearing only one of them is not what the cap asked for.
dependents: Option<usize>How many registered repositories use this manager, or None where dev-prune
cannot say.
None is not zero. It is the honest answer for the five caches no adapter is
named after — pip, nuget, vcpkg, conan, conda, hex — where deciding which
projects feed them would mean inventing a mapping dev-prune has never verified,
and it is the answer again when there is no registry to compare against. Only
Some(0) means “nothing registered on this machine needs this”, and that is the
one reading devp caches clear --unused is allowed to act on.
extra_args: Vec<String>Arguments appended to Self::clear’s command for this row alone.
Empty for every cache a manager finds on its own. It exists for the one that a
manager does not: pnpm store prune prunes the store for the filesystem it is
run on, so emptying a store on another volume means naming it. Appended to both
the command dev-prune runs and the Self::clear_command it prints, so the two
cannot say different things.
Auto Trait Implementations§
impl Freeze for CacheReport
impl RefUnwindSafe for CacheReport
impl Send for CacheReport
impl Sync for CacheReport
impl Unpin for CacheReport
impl UnsafeUnpin for CacheReport
impl UnwindSafe for CacheReport
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
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> ⓘ
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> ⓘ
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