Enum cache::Cached[][src]

pub enum Cached<'a, V: 'a> {
    Spilled(Box<V>),
    Cached {
        guard: RwLockReadGuard<'a, ()>,
        ptr: *const ManuallyDrop<V>,
    },
    Borrowed(&'a V),
}

A reference type to a value in the cache, either carrying the value itself (if an insert failed), or a readlock into the memory slab.

Variants

Value could not be put on the cache, and is returned in a box as to be able to implement StableDeref

Value resides in cache and is read-locked.

Fields of Cached

The readguard from a lock on the heap

A pointer to a value on the heap

A value that was borrowed from outside the cache.

Methods

impl<'a, V: 'a> Cached<'a, V>
[src]

Borrow a value from outside the cache

impl<'a, V: 'a + Clone> Cached<'a, V>
[src]

Turns the cached value into an owned value by cloning

Trait Implementations

impl<'a, V> StableAddress for Cached<'a, V>
[src]

impl<'a, V> Debug for Cached<'a, V> where
    V: Debug
[src]

Formats the value using the given formatter. Read more

impl<'a, V> Deref for Cached<'a, V>
[src]

The resulting type after dereferencing.

Dereferences the value.

Auto Trait Implementations

impl<'a, V> !Send for Cached<'a, V>

impl<'a, V> !Sync for Cached<'a, V>