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§
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
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".