Expand description
The sysexits crate provides the system exit code constants as defined by
<sysexits.h>.
The ExitCode type implements the
Termination trait, so this can be returned
from the main function.
§Examples
use std::str;
use sysexits::ExitCode;
fn main() -> ExitCode {
let bytes = [0xF0, 0x9F, 0xA6, 0x80];
match str::from_utf8(&bytes) {
Ok(string) => {
assert_eq!(string, "🦀");
ExitCode::Ok
}
Err(err) => {
eprintln!("{err}");
ExitCode::DataErr
}
}
}Modules§
- error
std - Error types for this crate.
Enums§
- Exit
Code ExitCodeis a type that represents the system exit code constants as defined by<sysexits.h>.