pub struct CoverageCache { /* private fields */ }Expand description
An LRU coverage cache with a byte budget.
Implementations§
Source§impl CoverageCache
impl CoverageCache
Sourcepub fn get(&mut self, key: u128) -> Option<Arc<TileCoverage>>
pub fn get(&mut self, key: u128) -> Option<Arc<TileCoverage>>
The coverage kept under key, now the most recently used.
Sourcepub fn insert(&mut self, key: u128, coverage: Arc<TileCoverage>)
pub fn insert(&mut self, key: u128, coverage: Arc<TileCoverage>)
Stores coverage under key, evicting least recently used entries until it fits.
Coverage larger than the whole budget is not stored.
Sourcepub const fn hit_counts(&self) -> (u64, u64)
pub const fn hit_counts(&self) -> (u64, u64)
Hit and miss counts.
Trait Implementations§
Source§impl Debug for CoverageCache
impl Debug for CoverageCache
Auto Trait Implementations§
impl Freeze for CoverageCache
impl RefUnwindSafe for CoverageCache
impl Send for CoverageCache
impl Sync for CoverageCache
impl Unpin for CoverageCache
impl UnsafeUnpin for CoverageCache
impl UnwindSafe for CoverageCache
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