pub struct CoverageCache { /* private fields */ }Expand description
Coverage by key, least recently used first out, within 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>)
Keeps coverage under key, dropping the least recently used until
it fits. Coverage larger than the whole budget is not kept.
Sourcepub const fn hit_counts(&self) -> (u64, u64)
pub const fn hit_counts(&self) -> (u64, u64)
Lookups that found coverage, and ones that did not.
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