Struct uluru::LRUCache [] [src]

pub struct LRUCache<T, A: Array<Item = Entry<T>>> { /* fields omitted */ }

A LRU cache using a statically-sized array for storage.

The most-recently-used entry is at index head. The entries form a linked list, linked to each other by indices within the entries array. After an entry is added to the array, its index never changes, so these links are never invalidated.

Methods

impl<T, A: Array<Item = Entry<T>>> LRUCache<T, A>
[src]

[src]

Returns the number of elements in the cache.

[src]

Touch a given entry, putting it first in the list.

[src]

Returns the front entry in the list (most recently used).

[src]

Returns a mutable reference to the front entry in the list (most recently used).

[src]

Iterate over the contents of this cache, from more to less recently used.

[src]

Iterate mutably over the contents of this cache.

[src]

Performs a lookup on the cache with the given test routine. Touches the result on a hit.

[src]

Insert a given key in the cache.

[src]

Evict all elements from the cache.

Trait Implementations

impl<T, A: Array<Item = Entry<T>>> Default for LRUCache<T, A>
[src]

[src]

Returns the "default value" for a type. Read more