Skip to main content

Cacheable

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

Table data that can be materialized into an in-memory map.

Required Associated Types§

Source

type K

Key type for the cache map.

Source

type V

Value type for the cache map.

Required Methods§

Source

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

Build the cache from the database.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§