pub struct CacheEntry {
pub url: String,
pub etag: Option<String>,
pub last_modified: Option<u64>,
pub cached_at: u64,
pub size: u64,
pub checksum: [u8; 32],
pub access_count: u64,
pub last_accessed: u64,
pub max_age: Option<u64>,
pub no_cache: bool,
}Expand description
Cache entry metadata.
Fields§
§url: StringThe URL that was cached
etag: Option<String>ETag from the server
last_modified: Option<u64>Last-Modified from the server
cached_at: u64When the entry was cached
size: u64Size of the cached content
checksum: [u8; 32]SHA256 checksum of the content
access_count: u64Number of times this entry was accessed
last_accessed: u64Last access time
max_age: Option<u64>Cache control max-age from server
no_cache: boolCache control no-cache directive
Implementations§
Source§impl CacheEntry
impl CacheEntry
Sourcepub fn is_expired(&self, config_max_age: Option<Duration>) -> bool
pub fn is_expired(&self, config_max_age: Option<Duration>) -> bool
Check if the entry is expired based on its age and max_age.
Sourcepub fn should_revalidate(&self) -> bool
pub fn should_revalidate(&self) -> bool
Check if the entry should be revalidated.
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CacheEntry
impl Debug for CacheEntry
Source§impl<'de> Deserialize<'de> for CacheEntry
impl<'de> Deserialize<'de> for CacheEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto 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