Trait Cacheable

Source
pub trait Cacheable {
    type K;
    type V;

    // Required method
    fn cache(db: &Connection) -> Result<HashMap<Self::K, Self::V>, TableError>;
}
Expand description

Defines behavior for table data that can be cached in memory

Required Associated Types§

Source

type K

The key type for the cache HashMap

Source

type V

The value type for the cache HashMap

Required Methods§

Source

fn cache(db: &Connection) -> Result<HashMap<Self::K, Self::V>, TableError>

Caches the table data in a HashMap

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.

Implementors§