Skip to main content

DisplayDriver

Trait DisplayDriver 

Source
pub trait DisplayDriver {
    // Required methods
    fn screen(&self) -> Screen;
    fn flush(&mut self, area: Rect, colors: &[Color]);

    // Provided method
    fn vsync(&mut self) { ... }
}
Expand description

Trait implemented by display drivers.

Required Methods§

Source

fn screen(&self) -> Screen

Return the screen geometry (logical size + scan rotation).

Applications use Screen::logical_size to size widgets; renderers and compositors consult Screen::rotation to map logical coordinates onto the physical framebuffer.

Source

fn flush(&mut self, area: Rect, colors: &[Color])

Flush a rectangular region of pixels to the display.

area and colors are in logical coordinates. The driver is responsible for rotating them into the physical framebuffer according to its Screen::rotation.

Provided Methods§

Source

fn vsync(&mut self)

Optional vertical sync hook.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§