Skip to main content

ExternalTexture

Trait ExternalTexture 

Source
pub trait ExternalTexture:
    Debug
    + Send
    + Sync {
    // Required method
    fn as_any(&self) -> &dyn Any;
}
Expand description

A texture an application rendered itself, handed to Telar to place in the frame.

Deliberately opaque here: this crate is the vocabulary the CPU rasterizer shares with the GPU one, and naming a wgpu type would drag the whole GPU stack into builds that never touch one. The backend that can use the handle downcasts it; the one that cannot ignores the command.

Which means the trait is public for the backends, not for applications: a handle only draws through the backend that made it, so an implementation written outside one is recognised by nobody and its image comes out empty (with a warning). Applications build these with telar::gpu::image.

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§