3 releases

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

#336 in Algorithms

Download history 19451/week @ 2023-12-17 11780/week @ 2023-12-24 15160/week @ 2023-12-31 21613/week @ 2024-01-07 22442/week @ 2024-01-14 19368/week @ 2024-01-21 21984/week @ 2024-01-28 21499/week @ 2024-02-04 25278/week @ 2024-02-11 25476/week @ 2024-02-18 24033/week @ 2024-02-25 22422/week @ 2024-03-03 23578/week @ 2024-03-10 21912/week @ 2024-03-17 21660/week @ 2024-03-24 22703/week @ 2024-03-31

91,773 downloads per month
Used in 59 crates (3 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