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§
Sourcefn screen(&self) -> Screen
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.
Sourcefn flush(&mut self, area: Rect, colors: &[Color])
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§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".