Skip to main content

ImageExt

Trait ImageExt 

Source
pub trait ImageExt: Sized {
    // Required methods
    fn use_render_image(
        self: Arc<Self>,
        window: &mut Window<'_>,
        cx: &mut App,
    ) -> Option<Arc<RenderImage>>;
    fn get_render_image(
        self: Arc<Self>,
        window: &mut Window<'_>,
        cx: &mut App,
    ) -> Option<Arc<RenderImage>>;
    fn remove_asset(self: Arc<Self>, cx: &mut App);
    fn to_image_data(
        &self,
        svg_renderer: SvgRenderer,
    ) -> Result<Arc<RenderImage>, Error>;
}
Expand description

Operations on Image that integrate it with GPUI’s rendering and asset systems.

The data-only parts of Image live in gpui_platform; this trait adds the operations that require App, a Window, or the render pipeline.

Required Methods§

Source

fn use_render_image( self: Arc<Self>, window: &mut Window<'_>, cx: &mut App, ) -> Option<Arc<RenderImage>>

Use the GPUI use_asset API to make this image renderable

Source

fn get_render_image( self: Arc<Self>, window: &mut Window<'_>, cx: &mut App, ) -> Option<Arc<RenderImage>>

Use the GPUI get_asset API to make this image renderable

Source

fn remove_asset(self: Arc<Self>, cx: &mut App)

Use the GPUI remove_asset API to drop this image, if possible.

Source

fn to_image_data( &self, svg_renderer: SvgRenderer, ) -> Result<Arc<RenderImage>, Error>

Convert the clipboard image to an ImageData object.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§