Skip to main content

PruneOptions

Struct PruneOptions 

Source
pub struct PruneOptions {
    pub idle_days: u64,
    pub dry_run: bool,
    pub force: bool,
    pub only_dirs: Option<Vec<String>>,
    pub adapters: AdapterFilter,
    pub min_size_bytes: u64,
    pub scan_depth: usize,
    pub allow_manifest_rewrite: bool,
    pub command_timeout_secs: u64,
    pub build_idle_days: u64,
    pub adapter_idle_days: BTreeMap<String, u64>,
}
Expand description

Everything that shapes a prune pass beyond the repository itself.

Default is written out rather than derived: scan_depth has a real default that is not zero, and a derived one would have made every ..Default::default() call site quietly walk a single level and report a monorepo as empty.

Fields§

§idle_days: u64

Days of inactivity required before the repository is eligible.

§dry_run: bool

Report sizes and stop. Nothing is verified and nothing is deleted.

§force: bool

Bypass the idle check. Lockfile verification still applies.

§only_dirs: Option<Vec<String>>

Restrict the pass to these repository-relative bloat directory labels.

Some means a caller has already chosen — the interactive selector, or the second phase of devp run. The size floor is not applied on top of an explicit choice, because the caller has already decided these directories are wanted.

§adapters: AdapterFilter

Which package managers may act.

§min_size_bytes: u64

Smallest directory worth deleting. 0 disables the floor.

§scan_depth: usize

How deep to walk each repository looking for projects.

The global setting. A repository’s own .devprune.json may raise or lower it — see workspace::resolve_depth, which this is fed into.

§allow_manifest_rewrite: bool

Whether an adapter may run the sync command that rewrites its tracked lockfile.

§command_timeout_secs: u64

Ceiling on any one package-manager command, in seconds.

The user’s command_timeout_secs. It was settable, displayed by devp status and named in the timeout message long before anything actually read it here.

§build_idle_days: u64

Idle days required before build-tree directories are touched.

Applied as max(build_idle_days, idle_days), only to adapters that answer crate::adapters::PackageManager::opt_in — cargo, gradle, maven and swift. A recompile costs more than a reinstall, so those directories wait longer.

§adapter_idle_days: BTreeMap<String, u64>

Per-adapter idle windows, keyed by adapter name; the user’s adapter_idle_days.

A floor on top of everything else, never a bypass — see PruneOptions::idle_threshold_for.

Implementations§

Source§

impl PruneOptions

Source

pub fn new(idle_days: u64, dry_run: bool, force: bool) -> Self

The common case: prune everything eligible in this repository.

Trait Implementations§

Source§

impl Clone for PruneOptions

Source§

fn clone(&self) -> PruneOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PruneOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PruneOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.