Struct hirofa_utils::cache::Cache [−][src]
Implementations
impl<K: Eq + Hash, O> Cache<K, O>
[src]
pub fn new<P>(producer: P, max_inactive_time: Duration, max_size: usize) -> Self where
P: Fn(&K) -> Option<O> + 'static,
[src]
P: Fn(&K) -> Option<O> + 'static,
pub fn len(&self) -> usize
[src]
pub fn is_empty(&self) -> bool
[src]
Trait Implementations
impl<K: Eq + Hash + Clone, O> CacheIFace<K, O> for Cache<K, O>
[src]
fn invalidate_all(&mut self)
[src]
fn invalidate_stale(&mut self)
[src]
fn opt(&mut self, key: &K) -> Option<&O>
[src]
fn opt_mut(&mut self, key: &K) -> Option<&mut O>
[src]
fn opt_no_touch(&self, key: &K) -> Option<&O>
[src]
fn get(&mut self, key: &K) -> Option<&O>
[src]
fn get_mut(&mut self, key: &K) -> Option<&mut O>
[src]
fn contains_key(&self, key: &K) -> bool
[src]
fn invalidate(&mut self, key: &K)
[src]
fn insert(&mut self, key: K, item: O)
[src]
Auto Trait Implementations
impl<K, O> !RefUnwindSafe for Cache<K, O>
impl<K, O> !Send for Cache<K, O>
impl<K, O> !Sync for Cache<K, O>
impl<K, O> Unpin for Cache<K, O>
impl<K, O> !UnwindSafe for Cache<K, O>
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,
pub 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.
pub 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>,