3 releases

0.1.2 Mar 14, 2023
0.1.1 Oct 11, 2019
0.1.0 Oct 7, 2019

#598 in Algorithms

Download history 19849/week @ 2024-07-21 18208/week @ 2024-07-28 19119/week @ 2024-08-04 18903/week @ 2024-08-11 20918/week @ 2024-08-18 18244/week @ 2024-08-25 18230/week @ 2024-09-01 18361/week @ 2024-09-08 16862/week @ 2024-09-15 18914/week @ 2024-09-22 20948/week @ 2024-09-29 20823/week @ 2024-10-06 20610/week @ 2024-10-13 19134/week @ 2024-10-20 20556/week @ 2024-10-27 19646/week @ 2024-11-03

81,625 downloads per month
Used in 84 crates (4 directly)

Apache-2.0

7KB
94 lines

cvt

Build Status Docs crates-io-badge

This package exposes the cvt function used extensively by libstd to convert platform-specific syscall error codes to std::io::Result.

Usually syscalls use return values for errors, the conventions differ. For instance, on Unix 0 means success on Unix but failure on Windows.

While those conventions are not always followed, they usually are and cvt is there to reduce the mental bookkeeping and make it easier to handle syscall errors.

The code was mostly copied over from Rust libstd, because the function is not public.


lib.rs:

This package exposes the cvt function used extensively by libstd to convert platform-specific syscall error codes to std::io::Result.

Usually syscalls use return values for errors, the conventions differ. For instance, on Unix 0 usually means success on Unix but failure on Windows. While those conventions are not always followed, they usually are and cvt is there to reduce the mental bookkeeping and make it easier to handle syscall errors.

The code was mostly copied over from Rust libstd, because the function is not public.

Dependencies

~4KB