Skip to main content

Thumbnailer

Trait Thumbnailer 

Source
pub trait Thumbnailer: Send + Sync {
    // Required methods
    fn made_with(&self) -> &str;
    fn reads(&self, media_type: &str) -> bool;
    fn make(&self, picture: &[u8]) -> Option<Thumbnail>;
}
Expand description

What reads pictures and makes their thumbnails, which a program brings: nib and apps on a computer bring decoders in memory-safe Rust. An app on Android brings none: it makes thumbnails with the phone’s own decoders and hands them over, through Library::record_thumbnails_made. It runs on several threads at once.

Required Methods§

Source

fn made_with(&self) -> &str

How it makes thumbnails, as each records it, such as nibkeep 1: who makes them, and the version of their way, which counts up when the way changes.

Source

fn reads(&self, media_type: &str) -> bool

Whether it reads pictures of this media type, as their first bytes tell it, such as image/jpeg.

Source

fn make(&self, picture: &[u8]) -> Option<Thumbnail>

The thumbnail of a picture, from its bytes, or None if it cannot read them: a JPEG whose longer side is at most 512 pixels, upright, without metadata.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§