3 releases

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

#513 in Algorithms

Download history 21295/week @ 2024-06-13 21282/week @ 2024-06-20 19958/week @ 2024-06-27 21029/week @ 2024-07-04 20045/week @ 2024-07-11 19302/week @ 2024-07-18 19008/week @ 2024-07-25 18525/week @ 2024-08-01 19128/week @ 2024-08-08 19429/week @ 2024-08-15 20292/week @ 2024-08-22 18150/week @ 2024-08-29 17696/week @ 2024-09-05 18910/week @ 2024-09-12 16569/week @ 2024-09-19 16261/week @ 2024-09-26

72,515 downloads per month
Used in 77 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