Skip to main content

ImageLoader

Trait ImageLoader 

Source
pub trait ImageLoader {
    // Required method
    fn load(&self, url: &str) -> Option<Vec<u8>>;
}
Expand description

Resolves image urls to bytes.

The whole file, not a prefix: the header sizes the box and the same bytes are what a painter embeds.

Required Methods§

Source

fn load(&self, url: &str) -> Option<Vec<u8>>

The bytes behind one url, or None when the host cannot resolve it.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl ImageLoader for Assets

The images a host already handed over answer by the url they were registered under, with the bytes as they arrived.

Source§

impl ImageLoader for NoImages