pub struct LruReplacer<F: FrameId> { /* private fields */ }Expand description
Least Recently Used (LRU) frame replacer.
This implementation uses a priority queue to manage the frames. The priority queue is ordered by the last access time of the frames. The most recently accessed frame is pushed to the back of the queue, while the least recently accessed item is the first to be evicted.
Implementations§
Trait Implementations§
Source§impl<F: FrameId> EvictionPolicy<F> for LruReplacer<F>
impl<F: FrameId> EvictionPolicy<F> for LruReplacer<F>
Source§type Error = EvictError<F>
type Error = EvictError<F>
Error type for the eviction policy.
Source§fn touch(&self, id: F) -> EvictResult<(), F>
fn touch(&self, id: F) -> EvictResult<(), F>
Notifies the policy manager that a page controlled by the frame has been
referenced/accessed. Read more
Source§fn touch_with<T: AccessType>(
&self,
id: F,
_access_type: T,
) -> EvictResult<(), F>
fn touch_with<T: AccessType>( &self, id: F, _access_type: T, ) -> EvictResult<(), F>
Notifies the policy manager that a page controlled by the frame has been
referenced/accessed. In addition to mere occurrence of access, this
method also logs the type of the access.
Source§fn pin(&self, id: F) -> EvictResult<(), F>
fn pin(&self, id: F) -> EvictResult<(), F>
Pin a frame, marking it as non-evictable. Read more
Auto Trait Implementations§
impl<F> Freeze for LruReplacer<F>
impl<F> !RefUnwindSafe for LruReplacer<F>
impl<F> Send for LruReplacer<F>
impl<F> Sync for LruReplacer<F>
impl<F> Unpin for LruReplacer<F>
impl<F> !UnwindSafe for LruReplacer<F>
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