pub struct ArtifactCachePrunePolicy { /* private fields */ }Expand description
Caller-selected retention limits for content-addressed artifact entries.
Age pruning runs before size pruning. A policy without either limit scans the selected cache namespace and updates its cache metadata without removing entries. Entries retained by live acquisition records are skipped, even when this temporarily exceeds the limits. They become eligible for the next maintenance pass after their final owner drops or its process exits.
Implementations§
Source§impl ArtifactCachePrunePolicy
impl ArtifactCachePrunePolicy
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Create a policy that records cache metadata without removing entries.
Sourcepub const fn with_max_age(self, max_age: Duration) -> Self
pub const fn with_max_age(self, max_age: Duration) -> Self
Remove entries older than max_age before applying the size limit.
Sourcepub const fn with_max_size_bytes(self, bytes: u64) -> Self
pub const fn with_max_size_bytes(self, bytes: u64) -> Self
Remove least-recently-used entries until retained logical size is at most bytes.
Sourcepub const fn max_size_bytes(self) -> Option<u64>
pub const fn max_size_bytes(self) -> Option<u64>
Configured maximum logical cache size in bytes, if any.
Trait Implementations§
Source§impl Clone for ArtifactCachePrunePolicy
impl Clone for ArtifactCachePrunePolicy
impl Copy for ArtifactCachePrunePolicy
Source§impl Debug for ArtifactCachePrunePolicy
impl Debug for ArtifactCachePrunePolicy
Source§impl Default for ArtifactCachePrunePolicy
impl Default for ArtifactCachePrunePolicy
impl Eq for ArtifactCachePrunePolicy
Source§impl PartialEq for ArtifactCachePrunePolicy
impl PartialEq for ArtifactCachePrunePolicy
impl StructuralPartialEq for ArtifactCachePrunePolicy
Auto Trait Implementations§
impl Freeze for ArtifactCachePrunePolicy
impl RefUnwindSafe for ArtifactCachePrunePolicy
impl Send for ArtifactCachePrunePolicy
impl Sync for ArtifactCachePrunePolicy
impl Unpin for ArtifactCachePrunePolicy
impl UnsafeUnpin for ArtifactCachePrunePolicy
impl UnwindSafe for ArtifactCachePrunePolicy
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.