Trait AsyncRobot

Source
pub trait AsyncRobot {
    // Provided methods
    fn opcontrol(&mut self) -> impl Future<Output = Result> { ... }
    fn auto(&mut self) -> impl Future<Output = Result> { ... }
    fn disabled(&mut self) -> impl Future<Output = Result> { ... }
    fn comp_init(&mut self) -> impl Future<Output = Result> { ... }
}
Expand description

A trait for robot code that spins up the pros-rs async executor. This is the preferred trait to run robot code.

Provided Methods§

Source

fn opcontrol(&mut self) -> impl Future<Output = Result>

Runs during the operator control period. This function may be called more than once. For that reason, do not use Peripherals::takein this function.

Source

fn auto(&mut self) -> impl Future<Output = Result>

Runs during the autonomous period.

Source

fn disabled(&mut self) -> impl Future<Output = Result>

Runs continuously during the disabled period.

Source

fn comp_init(&mut self) -> impl Future<Output = Result>

Runs once when the competition system is initialized.

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§