pub struct CacheEntry<V> {
pub value: V,
pub expires_at: Option<Instant>,
}Expand description
A cache entry that optionally expires at a given instant.
Used internally by all cache implementations to support per-entry TTL.
Callers interact with the value type V via the Cache trait methods;
CacheEntry is exposed for advanced use cases (e.g. custom wrappers).
Fields§
§value: VThe stored value.
expires_at: Option<Instant>Optional expiry time. None means the entry never expires.
Implementations§
Source§impl<V> CacheEntry<V>
impl<V> CacheEntry<V>
Auto Trait Implementations§
impl<V> Freeze for CacheEntry<V>where
V: Freeze,
impl<V> RefUnwindSafe for CacheEntry<V>where
V: RefUnwindSafe,
impl<V> Send for CacheEntry<V>where
V: Send,
impl<V> Sync for CacheEntry<V>where
V: Sync,
impl<V> Unpin for CacheEntry<V>where
V: Unpin,
impl<V> UnsafeUnpin for CacheEntry<V>where
V: UnsafeUnpin,
impl<V> UnwindSafe for CacheEntry<V>where
V: UnwindSafe,
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