Struct multicache::MultiCache [−][src]
pub struct MultiCache<K, V> { /* fields omitted */ }
Methods
impl<K, V> MultiCache<K, V>
[src]
impl<K, V> MultiCache<K, V>
pub fn new(bytesize: usize) -> MultiCache<K, V> where
K: Hash + Eq,
[src]
pub fn new(bytesize: usize) -> MultiCache<K, V> where
K: Hash + Eq,
Create a new cache which will at most hold a total of bytesize in elements
pub fn put(&self, key: K, value: V, bytes: usize) where
K: Hash + Eq,
[src]
pub fn put(&self, key: K, value: V, bytes: usize) where
K: Hash + Eq,
Add a new element by key/value with a given bytesize, if after inserting this element we would be going over the bytesize of the cache first enough elements are evicted for that to not be the case
pub fn put_arc(&self, key: K, value: Arc<V>, bytes: usize) where
K: Hash + Eq,
[src]
pub fn put_arc(&self, key: K, value: Arc<V>, bytes: usize) where
K: Hash + Eq,
Add a new element by key/Arc
pub fn get(&self, key: &K) -> Option<Arc<V>> where
K: Hash + Eq,
[src]
pub fn get(&self, key: &K) -> Option<Arc<V>> where
K: Hash + Eq,
Get an element from the cache, updating it so it's now the most recently used and thus the last to be evicted
pub fn contains_key(&self, key: &K) -> bool where
K: Hash + Eq,
[src]
pub fn contains_key(&self, key: &K) -> bool where
K: Hash + Eq,
Check if a given key exists in the cache
Trait Implementations
impl<K: Debug, V: Debug> Debug for MultiCache<K, V>
[src]
impl<K: Debug, V: Debug> Debug for MultiCache<K, V>
Auto Trait Implementations
impl<K, V> Send for MultiCache<K, V> where
K: Send,
V: Send + Sync,
impl<K, V> Send for MultiCache<K, V> where
K: Send,
V: Send + Sync,
impl<K, V> Sync for MultiCache<K, V> where
K: Send,
V: Send + Sync,
impl<K, V> Sync for MultiCache<K, V> where
K: Send,
V: Send + Sync,