net_traits::image_cache

Trait ImageCache

source
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§

source

fn new(compositor_api: CrossProcessCompositorApi, rippy_data: Vec<u8>) -> Self
where Self: Sized,

source

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.

source

fn get_cached_image_status( &self, url: ServoUrl, origin: ImmutableOrigin, cors_setting: Option<CorsSettings>, use_placeholder: UsePlaceholder, ) -> ImageCacheResult

source

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.

source

fn notify_pending_response(&self, id: PendingImageId, action: FetchResponseMsg)

Inform the image cache about a response for a pending request.

Implementors§