std.sys.exit
Show source codeHide source code
fn pub exit(status: Int) -> Never {
sys.exit(status)
}
fn pub static exit(status: Int) -> Never
Terminates the program with the given exit status.
The exit status can be a number between -2147483648 and 2147483647.
When called, the current process terminates immediately, but other processes may continue to run for a short while. In addition, processes terminate without dropping any values that are still live.
If multiple processes call this method concurrently, the exit status is set to the value of the last call. Due to the order in which processes run, this may not be deterministic. It's recommended to only call this method from a single process (i.e. the main process).
Examples
import std.sys
sys.exit(1)