pub struct CleanupPolicy {
pub max_cache_size_mb: usize,
pub max_age_days: usize,
pub max_idle_days: usize,
pub remove_version_mismatch: bool,
}Expand description
Cleanup policy configuration
Fields§
§max_cache_size_mb: usizeMaximum cache size in MB
max_age_days: usizeMaximum age in days before entry is considered stale
max_idle_days: usizeMaximum idle days (since last access) before entry is stale
remove_version_mismatch: boolRemove entries with version mismatch
Implementations§
Source§impl CleanupPolicy
impl CleanupPolicy
Sourcepub fn is_stale(&self, entry: &CacheEntry, current_version: &str) -> bool
pub fn is_stale(&self, entry: &CacheEntry, current_version: &str) -> bool
Check if an entry is stale according to the policy
Trait Implementations§
Source§impl Clone for CleanupPolicy
impl Clone for CleanupPolicy
Source§fn clone(&self) -> CleanupPolicy
fn clone(&self) -> CleanupPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CleanupPolicy
impl Debug for CleanupPolicy
Source§impl Default for CleanupPolicy
impl Default for CleanupPolicy
Source§impl<'de> Deserialize<'de> for CleanupPolicy
impl<'de> Deserialize<'de> for CleanupPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CleanupPolicy
impl RefUnwindSafe for CleanupPolicy
impl Send for CleanupPolicy
impl Sync for CleanupPolicy
impl Unpin for CleanupPolicy
impl UnsafeUnpin for CleanupPolicy
impl UnwindSafe for CleanupPolicy
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