Crates.io | sysexits |
lib.rs | sysexits |
version | 0.8.1 |
source | src |
created_at | 2022-05-28 20:53:05.99841 |
updated_at | 2024-07-03 10:33:35.466288 |
description | The system exit codes as defined by |
homepage | |
repository | https://github.com/sorairolake/sysexits-rs |
max_upload_size | |
id | 596001 |
size | 113,819 |
sysexits-rs (sysexits
) is a library that provides the
system exit code constants as defined by <sysexits.h>
.
This library implements the Termination
trait, so this can be returned from
the main
function.
Add this to your Cargo.toml
:
[dependencies]
sysexits = "0.8.1"
use std::str;
use sysexits::ExitCode;
fn main() -> ExitCode {
let bytes = [0xf0, 0x9f, 0x92, 0x96];
match str::from_utf8(&bytes) {
Ok(string) => {
println!("{string}");
ExitCode::Ok
}
Err(err) => {
eprintln!("{err}");
ExitCode::DataErr
}
}
}
std
Enables features that depend on the standard library. This is enabled by default.
nightly
Enables features that depend on the nightly Rust.
extended_io_error
Enables features that depend on the io_error_more
feature. This also enables
std
. This is implied by nightly
.
no_std
supportThis supports no_std
mode. Disables the default
feature to enable this.
See the documentation for more details.
The minimum supported Rust version (MSRV) of this library is v1.74.0.
Please see CHANGELOG.adoc.
Please see CONTRIBUTING.adoc.
Copyright © 2022–2024 Shun Sakai and other contributors (see AUTHORS.adoc)
This library is distributed under the terms of either the Apache License 2.0 or the MIT License.
This project is compliant with version 3.0 of the REUSE Specification. See copyright notices of individual files for more details on copyright and licensing information.