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§
Provided Methods§
sourcefn get(
&mut self,
key: &ImageHash,
source: &ImageSource,
mode: ImageCacheMode,
downscale: Option<ImageDownscale>,
mask: Option<ImageMaskMode>,
) -> ProxyGetResult
fn get( &mut self, key: &ImageHash, source: &ImageSource, mode: ImageCacheMode, downscale: Option<ImageDownscale>, mask: Option<ImageMaskMode>, ) -> ProxyGetResult
Intercept a get request.
sourcefn remove(&mut self, key: &ImageHash, purge: bool) -> ProxyRemoveResult
fn remove(&mut self, key: &ImageHash, purge: bool) -> ProxyRemoveResult
Intercept a remove request.