pub struct InvalidatableEntry {
pub key: CacheKey,
pub tags: HashSet<CacheTag>,
pub created_at: SystemTime,
pub time_policies: Vec<TimeBasedPolicy>,
pub dependencies: HashSet<CacheKey>,
}Expand description
Cache entry with invalidation metadata
Fields§
§key: CacheKeyThe cache key
Associated tags
created_at: SystemTimeWhen this entry was created
time_policies: Vec<TimeBasedPolicy>Time-based invalidation policies
dependencies: HashSet<CacheKey>Dependencies on other cache keys
Implementations§
Source§impl InvalidatableEntry
impl InvalidatableEntry
pub fn new(key: CacheKey) -> Self
Sourcepub fn should_expire(&self) -> bool
pub fn should_expire(&self) -> bool
Check if this entry should be invalidated based on time policies
Add multiple tags to this entry
Sourcepub fn add_time_policy(&mut self, policy: TimeBasedPolicy)
pub fn add_time_policy(&mut self, policy: TimeBasedPolicy)
Add a time-based policy
Sourcepub fn add_dependency(&mut self, key: CacheKey)
pub fn add_dependency(&mut self, key: CacheKey)
Add a dependency on another key
Trait Implementations§
Source§impl Clone for InvalidatableEntry
impl Clone for InvalidatableEntry
Source§fn clone(&self) -> InvalidatableEntry
fn clone(&self) -> InvalidatableEntry
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 moreAuto Trait Implementations§
impl Freeze for InvalidatableEntry
impl RefUnwindSafe for InvalidatableEntry
impl Send for InvalidatableEntry
impl Sync for InvalidatableEntry
impl Unpin for InvalidatableEntry
impl UnsafeUnpin for InvalidatableEntry
impl UnwindSafe for InvalidatableEntry
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