core_pb::driving::peripherals

Trait RobotPeripheralsBehavior

Source
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§

Source

type Display: DrawTarget<Color = BinaryColor>

Source

type Error: Debug

Required Methods§

Source

async fn draw_display<F>(&mut self, draw: F)
where F: FnOnce(&mut Self::Display) -> Result<(), <Self::Display as DrawTarget>::Error>,

Source

async fn flip_screen(&mut self)

Source

async fn read_button_event(&mut self) -> Option<(RobotButton, bool)>

Source

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.

Implementors§