pub struct Entry<K, V>{ /* private fields */ }Expand description
Implementations§
Source§impl<K, V> Entry<K, V>
impl<K, V> Entry<K, V>
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Checks if the entry has passed its expiration deadline.
Returns true if expired_at is a time in the past relative to Instant::now.
If no expiration was set, this always returns false.
§Examples
use std::time::{Duration, Instant};
use omega_cache::core::entry::Entry;
// Entry that expired 1 second ago
let past = Instant::now() - Duration::from_secs(1);
let entry = Entry::new("key", "value", Some(past));
assert!(entry.is_expired());Trait Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for Entry<K, V>where
V: Freeze,
impl<K, V> RefUnwindSafe for Entry<K, V>where
V: RefUnwindSafe,
K: RefUnwindSafe,
impl<K, V> Send for Entry<K, V>
impl<K, V> Sync for Entry<K, V>
impl<K, V> Unpin for Entry<K, V>where
V: Unpin,
impl<K, V> UnsafeUnpin for Entry<K, V>where
V: UnsafeUnpin,
impl<K, V> UnwindSafe for Entry<K, V>where
V: UnwindSafe,
K: RefUnwindSafe,
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