Crate pros_async

source ·
Expand description

Tiny async runtime and robot traits for pros-rs. The async executor supports spawning tasks and blocking on futures. It has a reactor to improve the performance of some futures. It is recommended to use the AsyncRobot trait to run robot code. FreeRTOS tasks can still be used, but it is recommended to use only async tasks for performance.

Macros§

  • Allows your async robot code to be executed by the pros kernel. If your robot struct implements Default then you can just supply this macro with its type. If not, you can supply an expression that returns your robot type to initialize your robot struct. The code that runs to create your robot struct will run in the initialize function in PROS.

Structs§

  • A future that will complete after the given duration. Sleep futures that are closer to completion are prioritized to improve accuracy.

Traits§

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

Functions§

  • Blocks the current task untill a return value can be extracted from the provided future. Does not poll all futures to completion.
  • Returns a future that will complete after the given duration.
  • Runs a future in the background without having to await it To get the the return value you can await a task.