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.
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
Source§fn clone(&self) -> ArtifactCachePrunePolicy
fn clone(&self) -> ArtifactCachePrunePolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ArtifactCachePrunePolicy
Source§impl Debug for ArtifactCachePrunePolicy
impl Debug for ArtifactCachePrunePolicy
Source§impl Default for ArtifactCachePrunePolicy
impl Default for ArtifactCachePrunePolicy
Source§fn default() -> ArtifactCachePrunePolicy
fn default() -> ArtifactCachePrunePolicy
Returns the “default value” for a type. Read more
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.