Skip to main content

RendererFactory

Trait RendererFactory 

Source
pub trait RendererFactory<W>: 'static {
    // Required method
    fn build(
        &self,
        window: &W,
        build: RendererBuild<'_>,
    ) -> Result<Box<dyn RenderBackend + Send>, RendererError>;
}
Expand description

Builds the renderer for a surface — the seam an out-of-tree frontend installs to draw Telar’s frames itself.

Generic over the window type because that is the platform’s business: whoever brings a Platform brings the window this draws on. The backend is boxed and Send so the frame pipeline can move it to its own thread.

Required Methods§

Source

fn build( &self, window: &W, build: RendererBuild<'_>, ) -> Result<Box<dyn RenderBackend + Send>, RendererError>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§