pub struct Manager { /* private fields */ }
Expand description
A simple LRU eviction manager
The implementation is not optimized. All operations require global locks.
Implementations§
Trait Implementations§
Source§impl EvictionManager for Manager
impl EvictionManager for Manager
Source§fn total_size(&self) -> usize
fn total_size(&self) -> usize
Total size of the cache in bytes tracked by this eviction manager
Source§fn total_items(&self) -> usize
fn total_items(&self) -> usize
Number of assets tracked by this eviction manager
Source§fn evicted_size(&self) -> usize
fn evicted_size(&self) -> usize
Number of bytes that are already evicted Read more
Source§fn evicted_items(&self) -> usize
fn evicted_items(&self) -> usize
Number of assets that are already evicted Read more
Source§fn admit(
&self,
item: CompactCacheKey,
size: usize,
_fresh_until: SystemTime,
) -> Vec<CompactCacheKey>
fn admit( &self, item: CompactCacheKey, size: usize, _fresh_until: SystemTime, ) -> Vec<CompactCacheKey>
Admit an item Read more
Source§fn remove(&self, item: &CompactCacheKey)
fn remove(&self, item: &CompactCacheKey)
Remove an item from the eviction manager. Read more
Source§fn access(
&self,
item: &CompactCacheKey,
size: usize,
_fresh_until: SystemTime,
) -> bool
fn access( &self, item: &CompactCacheKey, size: usize, _fresh_until: SystemTime, ) -> bool
Access an item that should already be in cache. Read more
Source§fn peek(&self, item: &CompactCacheKey) -> bool
fn peek(&self, item: &CompactCacheKey) -> bool
Peek into the manager to see if the item is already tracked by the system Read more
Auto Trait Implementations§
impl !Freeze for Manager
impl !RefUnwindSafe for Manager
impl Send for Manager
impl Sync for Manager
impl Unpin for Manager
impl UnwindSafe for Manager
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