Skip to main content

RenderBackend

Trait RenderBackend 

Source
pub trait RenderBackend<I: SceneItem, const N: usize, R: ?Sized> {
    type Error;

    // Required method
    fn render_frame<'a>(
        &'a mut self,
        frame: FrameView<'a, I, N>,
        resources: &'a R,
    ) -> impl Future<Output = Result<(), Self::Error>> + 'a
       where I: 'a,
             R: 'a;
}
Expand description

A frame-level backend that consumes complete instance and change streams.

R is deliberately backend-specific. It may be an empty context, borrowed CPU bitmap bindings, native display handles, or GPU resource bindings. Backends may batch or cache the frame directly; implementations that need one-active-tile rendering normally use TiledBackend and implement TileRenderer instead. Returning success completes the backend side of the transaction, after which DisplayList::render commits the pending snapshot.

See the crate-level rendering-pipeline guide for ordering, resource-lifetime, and failure semantics.

Required Associated Types§

Source

type Error

The backend error.

Required Methods§

Source

fn render_frame<'a>( &'a mut self, frame: FrameView<'a, I, N>, resources: &'a R, ) -> impl Future<Output = Result<(), Self::Error>> + 'a
where I: 'a, R: 'a,

Renders one logical frame. Preparation that can fail should happen before the first visible display write.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<I, R, T, const N: usize> RenderBackend<I, N, R> for TiledBackend<T>
where I: SceneItem, R: ?Sized, T: TileRenderer<I, R>,