[−][src]Struct cached::stores::UnboundCache
Default unbounded cache
This cache has no size limit or eviction policy.
Note: This cache is in-memory only
Methods
impl<K: Hash + Eq, V> UnboundCache<K, V>
[src]
pub fn new() -> UnboundCache<K, V>
[src]
Creates an empty UnboundCache
pub fn with_capacity(size: usize) -> UnboundCache<K, V>
[src]
Creates an empty UnboundCache
with a given pre-allocated capacity
Trait Implementations
impl<K: Hash + Eq, V> Cached<K, V> for UnboundCache<K, V>
[src]
fn cache_get(&mut self, key: &K) -> Option<&V>
[src]
fn cache_get_mut(&mut self, key: &K) -> Option<&mut V>
[src]
fn cache_set(&mut self, key: K, val: V)
[src]
fn cache_remove(&mut self, k: &K) -> Option<V>
[src]
fn cache_clear(&mut self)
[src]
fn cache_reset(&mut self)
[src]
fn cache_size(&self) -> usize
[src]
fn cache_hits(&self) -> Option<u64>
[src]
fn cache_misses(&self) -> Option<u64>
[src]
fn cache_capacity(&self) -> Option<usize>
[src]
fn cache_lifespan(&self) -> Option<u64>
[src]
Auto Trait Implementations
impl<K, V> RefUnwindSafe for UnboundCache<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for UnboundCache<K, V> where
K: Send,
V: Send,
K: Send,
V: Send,
impl<K, V> Sync for UnboundCache<K, V> where
K: Sync,
V: Sync,
K: Sync,
V: Sync,
impl<K, V> Unpin for UnboundCache<K, V> where
K: Unpin,
V: Unpin,
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for UnboundCache<K, V> where
K: UnwindSafe,
V: UnwindSafe,
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,