Skip to main content

Renderer

Trait Renderer 

Source
pub trait Renderer: 'static {
    // Required method
    fn draw(
        &mut self,
        canvas: &mut Canvas<'_>,
        context: RenderContext,
    ) -> FrameAction;

    // Provided methods
    fn draw_surface(
        &mut self,
        _: SurfaceId,
        canvas: &mut Canvas<'_>,
        context: RenderContext,
    ) -> FrameAction { ... }
    fn closed(&mut self) { ... }
    fn closed_surface(&mut self, _: SurfaceId) { ... }
    fn configured_surface(&mut self, _: SurfaceId, _: u32, _: u32) { ... }
    fn output_added(&mut self, _: RenderOutput) { ... }
    fn output_updated(&mut self, _: RenderOutput) { ... }
    fn output_removed(&mut self, _: RenderOutput) { ... }
    fn pointer_event(&mut self, _: PointerEvent) -> InputAction { ... }
}

Required Methods§

Source

fn draw( &mut self, canvas: &mut Canvas<'_>, context: RenderContext, ) -> FrameAction

Provided Methods§

Source

fn draw_surface( &mut self, _: SurfaceId, canvas: &mut Canvas<'_>, context: RenderContext, ) -> FrameAction

Source

fn closed(&mut self)

Source

fn closed_surface(&mut self, _: SurfaceId)

Source

fn configured_surface(&mut self, _: SurfaceId, _: u32, _: u32)

Source

fn output_added(&mut self, _: RenderOutput)

Source

fn output_updated(&mut self, _: RenderOutput)

Source

fn output_removed(&mut self, _: RenderOutput)

Source

fn pointer_event(&mut self, _: PointerEvent) -> InputAction

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<F> Renderer for F
where F: for<'borrow, 'canvas> FnMut(&'borrow mut Canvas<'canvas>, RenderContext) -> FrameAction + 'static,