pub struct CacheStats { /* private fields */ }Expand description
Cache statistics
Implementations§
Source§impl CacheStats
impl CacheStats
Sourcepub fn record_hit(&self)
pub fn record_hit(&self)
Record a cache hit
Sourcepub fn record_miss(&self)
pub fn record_miss(&self)
Record a cache miss
Sourcepub fn record_eviction(&self)
pub fn record_eviction(&self)
Record a cache eviction
Sourcepub fn record_expired(&self)
pub fn record_expired(&self)
Record an expired entry removal
Sourcepub fn remove_entry(&self, size: usize)
pub fn remove_entry(&self, size: usize)
Remove from entry count
Sourcepub fn update_size(&self, delta: i64)
pub fn update_size(&self, delta: i64)
Update size (delta can be positive or negative)
Sourcepub fn total_size(&self) -> u64
pub fn total_size(&self) -> u64
Get total size in bytes
Sourcepub fn total_requests(&self) -> u64
pub fn total_requests(&self) -> u64
Get total requests
Trait Implementations§
Source§impl Debug for CacheStats
impl Debug for CacheStats
Source§impl Default for CacheStats
impl Default for CacheStats
Source§fn default() -> CacheStats
fn default() -> CacheStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for CacheStats
impl RefUnwindSafe for CacheStats
impl Send for CacheStats
impl Sync for CacheStats
impl Unpin for CacheStats
impl UnsafeUnpin for CacheStats
impl UnwindSafe for CacheStats
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