pub trait Img {
// Required methods
fn renderer_id(&self, renderer: &ViewRenderer) -> ImageTextureId;
fn size(&self) -> PxSize;
}Expand description
A loaded or loading image.
This trait is an interface for the renderer into the image API used in the application.
The ideal image format is BGRA with pre-multiplied alpha.
Required Methods§
Sourcefn renderer_id(&self, renderer: &ViewRenderer) -> ImageTextureId
fn renderer_id(&self, renderer: &ViewRenderer) -> ImageTextureId
Gets the image ID in the renderer namespace.
The image must be loaded asynchronously by self and does not need to
be loaded yet when the key is returned.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".