pub trait WritePixels {
// Required method
async fn write_pixels(
&mut self,
data: &[u8],
bit_depth: BitDepth,
area: Rectangle,
);
// Provided method
async fn flush<C>(&mut self, fb: &Framebuffer<'_, C>, top_left: Point)
where C: PixelColor + ToBytes { ... }
}
Expand description
Convenience trait to hide details of the driver type.
Once the display driver is created, only the error type depends on the HAL types used for the implementation. For the use cases where panic on error is acceptable, we can ignore the type parameters.
Required Methods§
Sourceasync fn write_pixels(
&mut self,
data: &[u8],
bit_depth: BitDepth,
area: Rectangle,
)
async fn write_pixels( &mut self, data: &[u8], bit_depth: BitDepth, area: Rectangle, )
Provided Methods§
Sourceasync fn flush<C>(&mut self, fb: &Framebuffer<'_, C>, top_left: Point)where
C: PixelColor + ToBytes,
async fn flush<C>(&mut self, fb: &Framebuffer<'_, C>, top_left: Point)where
C: PixelColor + ToBytes,
Transfers the contents of the framebuffer to the display.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.