pub trait RobotPeripheralsBehavior {
type Display: DrawTarget<Color = BinaryColor>;
type Error: Debug;
// Required methods
async fn draw_display<F>(&mut self, draw: F)
where F: FnOnce(&mut Self::Display) -> Result<(), <Self::Display as DrawTarget>::Error>;
async fn flip_screen(&mut self);
async fn read_button_event(&mut self) -> Option<(RobotButton, bool)>;
async fn read_joystick(&mut self) -> Option<(f32, f32)>;
}
Expand description
Functionality that robots with peripherals must support
Required Associated Types§
Required Methods§
async fn draw_display<F>(&mut self, draw: F)
async fn flip_screen(&mut self)
async fn read_joystick(&mut self) -> Option<(f32, f32)>
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.