Trait zng_ext_image::ImageCacheProxy

source ·
pub trait ImageCacheProxy: Send + Sync {
    // Required method
    fn clear(&mut self, purge: bool);

    // Provided methods
    fn get(
        &mut self,
        key: &ImageHash,
        source: &ImageSource,
        mode: ImageCacheMode,
        downscale: Option<ImageDownscale>,
        mask: Option<ImageMaskMode>,
    ) -> ProxyGetResult { ... }
    fn remove(&mut self, key: &ImageHash, purge: bool) -> ProxyRemoveResult { ... }
}
Expand description

A custom proxy in IMAGES.

Implementers can intercept cache requests and redirect to another cache request or returns an image directly.

Required Methods§

source

fn clear(&mut self, purge: bool)

Called when the cache is cleaned or purged.

Provided Methods§

source

fn get( &mut self, key: &ImageHash, source: &ImageSource, mode: ImageCacheMode, downscale: Option<ImageDownscale>, mask: Option<ImageMaskMode>, ) -> ProxyGetResult

Intercept a get request.

source

fn remove(&mut self, key: &ImageHash, purge: bool) -> ProxyRemoveResult

Intercept a remove request.

Implementors§