pub trait ImageCache: Sync + Send {
// Required methods
fn new(
compositor_api: CrossProcessCompositorApi,
rippy_data: Vec<u8>,
) -> Self
where Self: Sized;
fn get_image(
&self,
url: ServoUrl,
origin: ImmutableOrigin,
cors_setting: Option<CorsSettings>,
) -> Option<Arc<Image>>;
fn get_cached_image_status(
&self,
url: ServoUrl,
origin: ImmutableOrigin,
cors_setting: Option<CorsSettings>,
use_placeholder: UsePlaceholder,
) -> ImageCacheResult;
fn add_listener(&self, listener: ImageResponder);
fn notify_pending_response(
&self,
id: PendingImageId,
action: FetchResponseMsg,
);
}
Required Methods§
fn new(compositor_api: CrossProcessCompositorApi, rippy_data: Vec<u8>) -> Selfwhere
Self: Sized,
sourcefn get_image(
&self,
url: ServoUrl,
origin: ImmutableOrigin,
cors_setting: Option<CorsSettings>,
) -> Option<Arc<Image>>
fn get_image( &self, url: ServoUrl, origin: ImmutableOrigin, cors_setting: Option<CorsSettings>, ) -> Option<Arc<Image>>
Definitively check whether there is a cached, fully loaded image available.
fn get_cached_image_status( &self, url: ServoUrl, origin: ImmutableOrigin, cors_setting: Option<CorsSettings>, use_placeholder: UsePlaceholder, ) -> ImageCacheResult
sourcefn add_listener(&self, listener: ImageResponder)
fn add_listener(&self, listener: ImageResponder)
Add a new listener for the given pending image id. If the image is already present, the responder will still receive the expected response.
sourcefn notify_pending_response(&self, id: PendingImageId, action: FetchResponseMsg)
fn notify_pending_response(&self, id: PendingImageId, action: FetchResponseMsg)
Inform the image cache about a response for a pending request.