pub struct MultiLevelCacheEntry<V> {
pub value: V,
pub created_at: SystemTime,
pub last_accessed: SystemTime,
pub access_count: u64,
pub level: u8,
pub size_bytes: u64,
pub ttl: u64,
pub prediction_score: f64,
}Expand description
Multi-level cache entry with metadata
Fields§
§value: VThe cached value
created_at: SystemTimeCreation timestamp
last_accessed: SystemTimeLast access timestamp
access_count: u64Access count
level: u8Cache level (1 for L1, 2 for L2)
size_bytes: u64Size in bytes (estimated)
ttl: u64Time to live (in seconds)
prediction_score: f64Prediction score for preheating
Implementations§
Source§impl<V> MultiLevelCacheEntry<V>
impl<V> MultiLevelCacheEntry<V>
Sourcepub fn mark_accessed(&mut self)
pub fn mark_accessed(&mut self)
Mark the entry as accessed
Sourcepub fn calculate_priority(&self) -> f64
pub fn calculate_priority(&self) -> f64
Calculate entry priority for eviction
Trait Implementations§
Source§impl<V: Clone> Clone for MultiLevelCacheEntry<V>
impl<V: Clone> Clone for MultiLevelCacheEntry<V>
Source§fn clone(&self) -> MultiLevelCacheEntry<V>
fn clone(&self) -> MultiLevelCacheEntry<V>
Returns a duplicate of the value. Read more
1.0.0 · 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 MultiLevelCacheEntry<V>where
V: Freeze,
impl<V> RefUnwindSafe for MultiLevelCacheEntry<V>where
V: RefUnwindSafe,
impl<V> Send for MultiLevelCacheEntry<V>where
V: Send,
impl<V> Sync for MultiLevelCacheEntry<V>where
V: Sync,
impl<V> Unpin for MultiLevelCacheEntry<V>where
V: Unpin,
impl<V> UnsafeUnpin for MultiLevelCacheEntry<V>where
V: UnsafeUnpin,
impl<V> UnwindSafe for MultiLevelCacheEntry<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