pub trait Displayable<SPI: SpiDevice, ERROR> {
// Required method
async fn update_display(&mut self, spi: &mut SPI) -> Result<(), ERROR>;
}Expand description
Base trait for any display where the display can be updated separate from its framebuffer data.
Required Methods§
Sourceasync fn update_display(&mut self, spi: &mut SPI) -> Result<(), ERROR>
async fn update_display(&mut self, spi: &mut SPI) -> Result<(), ERROR>
Updates (refreshes) the display based on what has been written to RAM. Note that this can be stateful, for example displays in DisplayPartial mode often swap two underlying framebuffers on calls to this method, resulting in the following behaviour:
- [DisplayPartial::write_diff_framebuffer] is used to turn the RAM all white.
- Displayable::update_display is called, which refreshes the display to be all white.
- [DisplayPartial::write_diff_framebuffer] is used to turn the RAM all black.
- Displayable::update_display is called, which refreshes the display to be all black.
- Displayable::update_display is called again, which refreshes the display to be all white again.
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.