[][src]Struct loa::Cache

pub struct Cache<K, T> { /* fields omitted */ }

Methods

impl<K, T> Cache<K, T> where
    K: Hash + Eq
[src]

pub fn new() -> Cache<K, T>[src]

impl<K, T> Cache<K, T> where
    T: Default + Clone,
    K: Hash + Eq + Clone
[src]

pub fn gate<F: FnOnce() -> T>(&self, key: &K, f: F) -> T[src]

impl<K, T> Cache<K, T> where
    T: Clone,
    K: Hash + Eq + Clone
[src]

pub fn set(&self, key: K, value: T)[src]

pub fn get(&self, key: &K) -> Option<T>[src]

pub fn gate_not_loop_safe<F: FnOnce() -> T>(&self, key: &K, f: F) -> T[src]

Trait Implementations

impl<K: Clone, T: Clone> Clone for Cache<K, T>[src]

Auto Trait Implementations

impl<K, T> RefUnwindSafe for Cache<K, T>

impl<K, T> Send for Cache<K, T> where
    K: Send,
    T: Send

impl<K, T> Sync for Cache<K, T> where
    K: Send,
    T: Send

impl<K, T> Unpin for Cache<K, T>

impl<K, T> UnwindSafe for Cache<K, T>

Blanket Implementations

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.