pub struct LruTreeBlockCache { /* private fields */ }Expand description
LRU-evicting TreeBlockCache keyed by logical address.
Hit/miss/insertion counters are tracked via atomics so reading
stats() doesn’t contend with cache traffic.
Implementations§
Trait Implementations§
Source§impl TreeBlockCache for LruTreeBlockCache
impl TreeBlockCache for LruTreeBlockCache
Source§fn get(&self, addr: u64) -> Option<Arc<TreeBlock>>
fn get(&self, addr: u64) -> Option<Arc<TreeBlock>>
Look up a tree block by logical address. Returns
None on miss.Source§fn put(&self, addr: u64, block: Arc<TreeBlock>)
fn put(&self, addr: u64, block: Arc<TreeBlock>)
Insert a freshly-read tree block into the cache. Implementations
decide eviction policy.
Source§fn invalidate(&self, addr: u64)
fn invalidate(&self, addr: u64)
Drop a single entry. Used by writers (e.g. the transaction crate
during
CoW) to invalidate stale blocks.Auto Trait Implementations§
impl !Freeze for LruTreeBlockCache
impl RefUnwindSafe for LruTreeBlockCache
impl Send for LruTreeBlockCache
impl Sync for LruTreeBlockCache
impl Unpin for LruTreeBlockCache
impl UnsafeUnpin for LruTreeBlockCache
impl UnwindSafe for LruTreeBlockCache
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