pub enum InvalidationStrategy {
Immediate,
Delayed {
delay_ms: u64,
},
EventBased {
events: Vec<InvalidationEventType>,
},
TagBased {
tags: Vec<EntityTag>,
},
TtlOnly,
Custom {
name: String,
},
}Expand description
Strategy for cache invalidation.
Variants§
Immediate
Invalidate on every write.
Delayed
Invalidate after a delay (batching).
EventBased
Invalidate based on events.
TagBased
Only invalidate specific tags.
Fields
TtlOnly
Time-based expiration only (no explicit invalidation).
Custom
Custom invalidation logic.
Implementations§
Source§impl InvalidationStrategy
impl InvalidationStrategy
Create a tag-based strategy.
Sourcepub fn should_invalidate(&self, event: &InvalidationEvent) -> bool
pub fn should_invalidate(&self, event: &InvalidationEvent) -> bool
Check if an event should trigger invalidation.
Trait Implementations§
Source§impl Clone for InvalidationStrategy
impl Clone for InvalidationStrategy
Source§fn clone(&self) -> InvalidationStrategy
fn clone(&self) -> InvalidationStrategy
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 InvalidationStrategy
impl Debug for InvalidationStrategy
Auto Trait Implementations§
impl Freeze for InvalidationStrategy
impl RefUnwindSafe for InvalidationStrategy
impl Send for InvalidationStrategy
impl Sync for InvalidationStrategy
impl Unpin for InvalidationStrategy
impl UnwindSafe for InvalidationStrategy
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