pub enum TimeBasedPolicy {
ExpiresAt(SystemTime),
Ttl(Duration),
Scheduled {
interval: Duration,
last_run: SystemTime,
},
}Expand description
Time-based invalidation policies
Variants§
ExpiresAt(SystemTime)
Absolute expiration time
Ttl(Duration)
Time-to-live duration
Scheduled
Scheduled expiration (cron-like, simplified)
Implementations§
Source§impl TimeBasedPolicy
impl TimeBasedPolicy
Sourcepub fn should_expire(&self, created_at: SystemTime) -> bool
pub fn should_expire(&self, created_at: SystemTime) -> bool
Check if this policy indicates expiration
Trait Implementations§
Source§impl Clone for TimeBasedPolicy
impl Clone for TimeBasedPolicy
Source§fn clone(&self) -> TimeBasedPolicy
fn clone(&self) -> TimeBasedPolicy
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 TimeBasedPolicy
impl RefUnwindSafe for TimeBasedPolicy
impl Send for TimeBasedPolicy
impl Sync for TimeBasedPolicy
impl Unpin for TimeBasedPolicy
impl UnsafeUnpin for TimeBasedPolicy
impl UnwindSafe for TimeBasedPolicy
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