Skip to main content

ThumbSource

Trait ThumbSource 

Source
pub trait ThumbSource<K> {
    // Required method
    fn thumb(&self, key: &K, size: u32) -> Thumb;

    // Provided method
    fn wanted(&self, keys: &[K], size: u32) { ... }
}
Expand description

Where thumbnails come from; the application implements it, loading them asynchronously (a thread, its engine), caching them, and asking for a repaint when one arrives.

Required Methods§

Source

fn thumb(&self, key: &K, size: u32) -> Thumb

key’s thumbnail for a cell size pixels square. Not ready yet: Thumb::Pending, and the source starts making it.

Provided Methods§

Source

fn wanted(&self, keys: &[K], size: u32)

The images in view this pass (and the size wanted): what to make first, and what may be dropped from a queue.

Implementors§

Source§

impl<K> ThumbSource<K> for ProviderThumbs<'_, K>