#[non_exhaustive]pub struct DropPromisedBlobsOptions {
pub now: OffsetDateTime,
pub min_size: u64,
pub keep_newer_than: Option<OffsetDateTime>,
pub dry_run: bool,
pub threads: Option<usize>,
}Expand description
Options for drop_promised_blobs.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.now: OffsetDateTimeCurrent time: for the gc.pid maintenance lock. Cutoffs are given explicitly
in Self::keep_newer_than.
min_size: u64Drop blobs of at least this many bytes (uncompressed), like a
blob:limit=<n> filter.
keep_newer_than: Option<OffsetDateTime>Keep blobs needed at or after this time (see the module documentation for
what counts as needed). None keeps nothing for recency.
dry_run: boolWork out what would be dropped without changing anything (and without taking the maintenance lock).
threads: Option<usize>Pack writing and indexing threads (None reads pack.threads).
Implementations§
Source§impl DropPromisedBlobsOptions
impl DropPromisedBlobsOptions
Sourcepub fn new(
now: OffsetDateTime,
min_size: u64,
keep_newer_than: Option<OffsetDateTime>,
) -> Self
pub fn new( now: OffsetDateTime, min_size: u64, keep_newer_than: Option<OffsetDateTime>, ) -> Self
Options that drop blobs of min_size bytes or more not needed since
keep_newer_than, at time now.
Sourcepub fn from_config(
config: &ConfigSet,
now: OffsetDateTime,
) -> Result<Option<Self>>
pub fn from_config( config: &ConfigSet, now: OffsetDateTime, ) -> Result<Option<Self>>
Options from maintenance.drop-large-blobs.minSize and
maintenance.drop-large-blobs.expire, at time now.
minSize takes Git’s k/m/g suffixes. When unset it is the smallest
blob:limit among the promisor remotes’ partialCloneFilter, or
DEFAULT_DROP_MIN_SIZE. expire is read with DropExpiry::parse
(DEFAULT_DROP_EXPIRE when unset).
§Returns
None when expire is DropExpiry::Never.
§Errors
ConfigError::BadNumericValue for a minSize that is not a non-negative
size, and ConfigError::InvalidDate for an expire that is not a date.
Sourcepub fn from_config_with_overrides(
config: &ConfigSet,
now: OffsetDateTime,
min_size: Option<u64>,
expiry: Option<DropExpiry>,
) -> Result<Option<Self>>
pub fn from_config_with_overrides( config: &ConfigSet, now: OffsetDateTime, min_size: Option<u64>, expiry: Option<DropExpiry>, ) -> Result<Option<Self>>
Self::from_config with values the caller gives (a command line’s
--min-size and --older-than) in place of the config ones.
A config key that is overridden is not read, so an invalid value there does not matter. The other one still comes from config, with the same defaults.
§Parameters
min_size: replacesmaintenance.drop-large-blobs.minSizeand its defaults.expiry: replacesmaintenance.drop-large-blobs.expire.
§Returns
None when the expiry in effect is DropExpiry::Never.
§Errors
As Self::from_config, for the keys that are read.
Trait Implementations§
Source§impl Clone for DropPromisedBlobsOptions
impl Clone for DropPromisedBlobsOptions
Source§impl Debug for DropPromisedBlobsOptions
impl Debug for DropPromisedBlobsOptions
impl Eq for DropPromisedBlobsOptions
Source§impl PartialEq for DropPromisedBlobsOptions
impl PartialEq for DropPromisedBlobsOptions
impl StructuralPartialEq for DropPromisedBlobsOptions
Auto Trait Implementations§
impl Freeze for DropPromisedBlobsOptions
impl RefUnwindSafe for DropPromisedBlobsOptions
impl Send for DropPromisedBlobsOptions
impl Sync for DropPromisedBlobsOptions
impl Unpin for DropPromisedBlobsOptions
impl UnsafeUnpin for DropPromisedBlobsOptions
impl UnwindSafe for DropPromisedBlobsOptions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.