Skip to main content

Cacheable

Trait Cacheable 

Source
pub trait Cacheable:
    Send
    + Sync
    + Clone
    + 'static {
    // Required method
    fn weight(&self) -> u32;
}
Expand description

A value type storable in ResourceCache.

Required Methods§

Source

fn weight(&self) -> u32

Approximate byte size, used as the moka eviction weight. Saturates at u32::MAX.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Cacheable for Bytes

Source§

fn weight(&self) -> u32

Source§

impl Cacheable for Vec<u8>

Source§

fn weight(&self) -> u32

Implementors§