Skip to main content

CacheEntry

Trait CacheEntry 

Source
pub trait CacheEntry:
    Any
    + Send
    + Sync {
    // Required method
    fn cost(&self) -> usize;
}
Expand description

Cached values expose their memory cost directly to the cache backends.

Required Methods§

Source

fn cost(&self) -> usize

Returns the cost of this value in bytes.

Implementations§

Source§

impl dyn CacheEntry

Source

pub fn downcast<T>(self: Arc<Self>) -> Option<Arc<T>>
where T: Send + Sync + 'static,

Attempts to downcast an Arc<dyn CacheEntry> to a concrete entry type.

Implementations on Foreign Types§

Source§

impl<T> CacheEntry for Arc<T>
where T: CacheEntry + ?Sized + 'static,

Source§

fn cost(&self) -> usize

Implementors§