Skip to main content

AppTextureBackend

Trait AppTextureBackend 

Source
pub trait AppTextureBackend:
    Send
    + Sync
    + Debug
    + 'static {
    // Required methods
    fn id(&self) -> AppTextureId;
    fn size_px(&self) -> (u32, u32);
    fn format(&self) -> SurfaceFormat;
    fn as_any(&self) -> &dyn Any;

    // Provided method
    fn backend_name(&self) -> &'static str { ... }
}
Expand description

Backend implementation of an AppTexture. Implemented by aetna-wgpu and aetna-vulkano against their native texture types; the runtime downcasts via Self::as_any in the backend’s record path.

Required Methods§

Source

fn id(&self) -> AppTextureId

Stable identity allocated by the constructor — must round-trip the same value on every call for the lifetime of self.

Source

fn size_px(&self) -> (u32, u32)

Pixel size of the underlying texture. The backend uses this for sanity checks; the widget rect comes from layout, not from here.

Source

fn format(&self) -> SurfaceFormat

Pixel format of the underlying texture. Used by the backend to pick a sampler / shader path.

Source

fn as_any(&self) -> &dyn Any

Downcast hatch for the backend’s record path. Each backend asserts the trait object is its own concrete type; mixing backends in one runtime is unsupported.

Provided Methods§

Source

fn backend_name(&self) -> &'static str

Human-readable concrete backend type for diagnostics.

Implementors§