Struct minigrep_study::example::closure::Cacher[][src]

pub struct Cacher<T, K, V> where
    T: Fn(K) -> V,
    K: Hash + Eq,
    V: Copy
{ /* fields omitted */ }

Implementations

impl<T, K, V> Cacher<T, K, V> where
    T: Fn(K) -> V,
    K: Hash + Eq + Copy,
    V: Copy
[src]

pub fn new(calculation: T) -> Cacher<T, K, V>[src]

pub fn value(&mut self, arg: K) -> V[src]

Auto Trait Implementations

impl<T, K, V> RefUnwindSafe for Cacher<T, K, V> where
    K: RefUnwindSafe,
    T: RefUnwindSafe,
    V: RefUnwindSafe

impl<T, K, V> Send for Cacher<T, K, V> where
    K: Send,
    T: Send,
    V: Send

impl<T, K, V> Sync for Cacher<T, K, V> where
    K: Sync,
    T: Sync,
    V: Sync

impl<T, K, V> Unpin for Cacher<T, K, V> where
    K: Unpin,
    T: Unpin,
    V: Unpin

impl<T, K, V> UnwindSafe for Cacher<T, K, V> where
    K: UnwindSafe,
    T: UnwindSafe,
    V: UnwindSafe

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.