[][src]Struct pagecache::Lru

pub struct Lru { /* fields omitted */ }

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

impl Sync for Lru[src]

Auto Trait Implementations

impl Unpin for Lru

impl !Send for Lru

impl UnwindSafe for Lru

impl !RefUnwindSafe for Lru

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]