pub struct GcConfig {
pub interval: Duration,
pub add_protected: Option<ProtectCb>,
}
Expand description
Configuration for garbage collection.
Fields§
§interval: Duration
Interval in which to run garbage collection.
add_protected: Option<ProtectCb>
Optional callback to manually add protected blobs.
The callback is called before each garbage collection run. It gets a &mut HashSet<Hash>
and returns a future that returns ProtectOutcome
. All hashes that are added to the
HashSet
will be protected from garbage collection during this run.
In normal operation, return ProtectOutcome::Continue
from the callback. If you return
ProtectOutcome::Abort
, the garbage collection run will be aborted.Use this if your
source of hashes to protect returned an error, and thus garbage collection should be skipped
completely to not unintentionally delete blobs that should be protected.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GcConfig
impl !RefUnwindSafe for GcConfig
impl Send for GcConfig
impl Sync for GcConfig
impl Unpin for GcConfig
impl !UnwindSafe for GcConfig
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
Mutably borrows from an owned value. Read more