pub struct Entry<K, V>{ /* private fields */ }Expand description
Implementations§
Source§impl<K, V> Entry<K, V>
impl<K, V> Entry<K, V>
pub fn with_ttl(key: K, value: V, ttl: Duration) -> Self
pub fn with_custom_expiration( key: K, value: V, is_expire: impl Fn() -> bool + 'static + Send + Sync, ) -> Self
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.
Auto Trait Implementations§
impl<K, V> Freeze for Entry<K, V>where
V: Freeze,
impl<K, V> !RefUnwindSafe for Entry<K, V>
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>
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