[−][src]Struct pagecache::Lru
A simple LRU cache.
Methods
impl Lru
[src]
pub fn new(cache_capacity: u64) -> Self
[src]
Instantiates a new Lru
cache.
pub fn accessed(&self, id: u64, item_size: u64) -> Vec<u64>
[src]
Called when an item is accessed. Returns a Vec of items to be evicted.
Items layout: items: 1 2 3 4 5 6 7 8 9 10 shards: 1 0 1 0 1 0 1 0 1 0 shard 0: 2 4 6 8 10 shard 1: 1 3 5 7 9
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,