pub struct CachedValue<V> {
pub value: V,
pub inserted_at: Instant,
}Expand description
A value stored in the L1 cache together with the Instant it was inserted.
The insertion time drives TTL expiry: an entry older than the cache’s configured TTL is treated as a miss, forcing a reload from the wrapped store.
Fields§
§value: VThe cached value.
inserted_at: InstantWhen this entry was inserted.
Implementations§
Source§impl<V> CachedValue<V>
impl<V> CachedValue<V>
Trait Implementations§
Source§impl<V: Clone> Clone for CachedValue<V>
impl<V: Clone> Clone for CachedValue<V>
Source§fn clone(&self) -> CachedValue<V>
fn clone(&self) -> CachedValue<V>
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<V> Freeze for CachedValue<V>where
V: Freeze,
impl<V> RefUnwindSafe for CachedValue<V>where
V: RefUnwindSafe,
impl<V> Send for CachedValue<V>where
V: Send,
impl<V> Sync for CachedValue<V>where
V: Sync,
impl<V> Unpin for CachedValue<V>where
V: Unpin,
impl<V> UnsafeUnpin for CachedValue<V>where
V: UnsafeUnpin,
impl<V> UnwindSafe for CachedValue<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