Skip to main content

CacheReport

Struct CacheReport 

Source
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 str

The package manager that owns it.

§kind: &'static str

Which of that manager’s caches this is, when it keeps more than one.

§path: PathBuf

Where it actually is, as resolved on this machine.

§bytes: u64

Total size on disk.

§clear_command: String

The 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: Clear

How 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: bool

Whether 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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.