pub struct CacheEntry {
pub data: Vec<u8>,
pub size_bytes: usize,
pub expires_at: Option<Instant>,
pub priority: u32,
pub last_accessed: Instant,
pub access_count: u64,
}Expand description
A single cached value together with its metadata.
Fields§
§data: Vec<u8>Raw value bytes.
size_bytes: usizeSize in bytes; if 0 the data.len() is used.
expires_at: Option<Instant>Optional expiry wall-clock instant.
priority: u32Logical priority tag (higher = more important to keep).
last_accessed: InstantWall-clock time at which this entry was last read.
access_count: u64Number of times this entry has been accessed.
Implementations§
Trait Implementations§
Source§impl Clone for CacheEntry
impl Clone for CacheEntry
Source§fn clone(&self) -> CacheEntry
fn clone(&self) -> CacheEntry
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 Freeze for CacheEntry
impl RefUnwindSafe for CacheEntry
impl Send for CacheEntry
impl Sync for CacheEntry
impl Unpin for CacheEntry
impl UnsafeUnpin for CacheEntry
impl UnwindSafe for CacheEntry
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