pub struct CacheStats {
pub hits: u64,
pub misses: u64,
pub occupied_slots: u64,
pub evictions: u64,
}Expand description
Cache hit/miss counters reported by codec contexts.
Fields§
§hits: u64Number of cache lookups that reused existing state.
misses: u64Number of cache lookups that had to build new state.
occupied_slots: u64Number of currently occupied cache slots.
evictions: u64Number of cache entries evicted by later insertions.
Implementations§
Source§impl CacheStats
impl CacheStats
Sourcepub const fn new(hits: u64, misses: u64) -> CacheStats
pub const fn new(hits: u64, misses: u64) -> CacheStats
Construct cache statistics from explicit counters.
Sourcepub const fn with_slots(
hits: u64,
misses: u64,
occupied_slots: u64,
evictions: u64,
) -> CacheStats
pub const fn with_slots( hits: u64, misses: u64, occupied_slots: u64, evictions: u64, ) -> CacheStats
Construct cache statistics from full counters.
Trait Implementations§
Source§impl Clone for CacheStats
impl Clone for CacheStats
Source§fn clone(&self) -> CacheStats
fn clone(&self) -> CacheStats
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 moreimpl Copy for CacheStats
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
impl Eq for CacheStats
Source§impl PartialEq for CacheStats
impl PartialEq for CacheStats
Source§fn eq(&self, other: &CacheStats) -> bool
fn eq(&self, other: &CacheStats) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CacheStats
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