Skip to main content

ThumbnailProvider

Trait ThumbnailProvider 

Source
pub trait ThumbnailProvider: Send + Sync {
    // Required method
    fn request(&self, ctx: &Context, request: &ThumbRequest<'_>) -> ThumbState;

    // Provided methods
    fn begin_frame(&self, _ctx: &Context) { ... }
    fn end_frame(&self, _ctx: &Context) { ... }
    fn cancel(&self, _path: &Path) { ... }
}
Expand description

Makes thumbnails off the interface thread. A frame starts with ThumbnailProvider::begin_frame, asks with ThumbnailProvider::request, and ends with ThumbnailProvider::end_frame: a request not renewed in a frame is cancelled, so what scrolled away leaves the queue without the mode’s help.

Required Methods§

Source

fn request(&self, ctx: &Context, request: &ThumbRequest<'_>) -> ThumbState

Answers at once from what is made; never blocks the frame.

Provided Methods§

Source

fn begin_frame(&self, _ctx: &Context)

Source

fn end_frame(&self, _ctx: &Context)

Source

fn cancel(&self, _path: &Path)

Cancels one request now.

Implementors§