Caches

Trait Caches 

Source
pub trait Caches<T: ?Sized>:
    Hash
    + Eq
    + Clone
    + CanCollect {
    // Required method
    fn cached(&self) -> &T;
}
Expand description

A container which can be used to cache values of type T

Required Methods§

Source

fn cached(&self) -> &T

Get a reference to the cached value of type T

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: Hash + Eq + ?Sized> Caches<T> for Rc<T>

Source§

fn cached(&self) -> &T

Source§

impl<T: Hash + Eq + ?Sized> Caches<T> for Arc<T>

Source§

fn cached(&self) -> &T

Source§

impl<T: Hash + Eq + ?Sized> Caches<T> for Arc<T>

Source§

fn cached(&self) -> &T

Implementors§

Source§

impl<A: Eq + Deref, P> Caches<[A]> for CachedArr<A, P>