chatora-errno 1.0.2

A thin Rust wrapper library around libc errno interface
Documentation
  • Coverage
  • 100%
    5 out of 5 items documented5 out of 5 items with examples
  • Size
  • Source code size: 36.56 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 311.94 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • takaomag

Crates.io docs.rs

chatora-errno

A thin Rust wrapper library around libc errno interface.

Examples

use chatora_errno::{clear_errno, describe_errno, get_errno, set_errno};

// Clear current errno.
clear_errno();

// Get the current value of errno.
let errno: i32 = get_errno();

assert_eq!(errno, 0);

// Equivalent to `clear_errno()`.
set_errno(0);

// Get string description of an errno.
let err_string: String = describe_errno(errno).unwrap();

assert_eq!(
    format!("{} (os error {})", err_string, errno),
    format!("{}", std::io::Error::from_raw_os_error(errno))
);
assert_eq!(err_string, "Success");

Usage

To use chatora-errno, add this to your Cargo.toml:

[dependencies]
chatora-errno = "1.0.2"

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.