Skip to main content

SweepPlan

Struct SweepPlan 

Source
pub struct SweepPlan {
Show 14 fields pub scanned: usize, pub loose_present: usize, pub packed_present: usize, pub live: usize, pub garbage: usize, pub loose_garbage: Vec<Hash>, pub loose_garbage_bytes: u64, pub packs_with_garbage: usize, pub packed_garbage_objects: usize, pub packs_to_remove: Vec<PathBuf>, pub packs_to_rewrite: Vec<PackRewrite>, pub orphan_files: Vec<PathBuf>, pub unreadable_packs: Vec<PathBuf>, pub bytes_reclaimable: u64,
}
Expand description

The result of enumerating the store and classifying garbage.

Produced by plan_sweep; embedded in SweepReport. Byte counts are on-disk sizes (compressed bytes for zstd builds).

Fields§

§scanned: usize

Distinct objects physically present (loose ∪ packed).

§loose_present: usize

Objects with a loose copy.

§packed_present: usize

Distinct objects with at least one packed copy.

§live: usize

Live objects actually present (live ∩ scanned).

§garbage: usize

Garbage objects: scanned − live, the sweep target.

§loose_garbage: Vec<Hash>

Garbage objects with a loose copy, sorted. Each entry is one removable file.

§loose_garbage_bytes: u64

On-disk bytes of Self::loose_garbage files.

§packs_with_garbage: usize

Packs containing at least one garbage object (before the coverage rule decides remove-vs-rewrite).

§packed_garbage_objects: usize

Garbage objects with at least one packed copy, counted once per pack that holds them (a hash packed twice counts twice, and a hash with both loose and packed garbage copies is counted here and in Self::loose_garbage). Self::garbage remains the distinct total.

§packs_to_remove: Vec<PathBuf>

Packs removed outright (all garbage, or live contents fully covered elsewhere), sorted.

§packs_to_rewrite: Vec<PackRewrite>

Packs to be rewritten without their garbage.

§orphan_files: Vec<PathBuf>

Files in the pack directory that cannot ever be read: a .pack without .idx or an .idx without a .pack. Swept like garbage.

§unreadable_packs: Vec<PathBuf>

Packs whose .idx failed to load. Their contents are unknown, so they are never touched — deleting one could destroy live data. Investigate manually.

§bytes_reclaimable: u64

Exact on-disk bytes reclaimable by deleting loose garbage and removed packs. Pack rewrites are excluded: their savings depend on recompression and are only known after execution (see SweepReport::bytes_reclaimed).

Trait Implementations§

Source§

impl Clone for SweepPlan

Source§

fn clone(&self) -> SweepPlan

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 SweepPlan

Source§

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

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

impl Default for SweepPlan

Source§

fn default() -> SweepPlan

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

impl Eq for SweepPlan

Source§

impl PartialEq for SweepPlan

Source§

fn eq(&self, other: &SweepPlan) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SweepPlan

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.