pub struct Cache(RefCell<HashMap<TypeId, Box<dyn Any>>>);
Expand description
This is essentially a HashMap
which allows storing any type in its input and
any type in its output. It is a write-once cache; values are never evicted,
which means that references to the value can safely be returned from the
get()
method.
Tuple Fields§
§0: RefCell<HashMap<TypeId, Box<dyn Any>>>
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Cache
impl !RefUnwindSafe for Cache
impl !Send for Cache
impl !Sync for Cache
impl Unpin for Cache
impl !UnwindSafe for Cache
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Pointable for T
impl<T> Pointable for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 56 bytes