Function exit

Source
pub fn exit() -> !
Expand description

Exits the program using vexSystemExitRequest.

This function will block up to 15mS to allow the serial buffer to flush, then either exit the program or block for an indefinite amount of time depending on how long it takes VEXos to kill the program.

Note that because this function never returns, and that it terminates the process, no destructors on the current stack will be run. If a clean shutdown is needed it is recommended to only call this function at a known point where there are no more destructors left to run; or, preferably, simply return a type implementing Termination (such as Result) from the main function and avoid this function altogether:

#[vexide::main]
async fn main(peripherals: Peripherals) -> Result<(), MyError> {
   // ...
   Ok(())
}