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§
- async_
robot - 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§
- Sleep
Future - A future that will complete after the given duration. Sleep futures that are closer to completion are prioritized to improve accuracy.
Traits§
- Async
Robot - A trait for robot code that spins up the pros-rs async executor. This is the preferred trait to run robot code.
Functions§
- block_
on - Blocks the current task untill a return value can be extracted from the provided future. Does not poll all futures to completion.
- sleep
- Returns a future that will complete after the given duration.
- spawn
- Runs a future in the background without having to await it To get the the return value you can await a task.