23 releases (6 breaking)
|0.6.9||May 23, 2021|
|0.6.5||Apr 30, 2021|
|0.6.2||Mar 2, 2021|
#26 in Operating systems
9,044 downloads per month
Used in 34 crates (19 directly)
Have you ever found yourself writing essentially the same code twice, once for
RawFd for Posix-ish platforms and once for
for Windows platforms? This crate abstracts over those platform differences.
Being non-owning, these handles operate much like raw pointers in Rust. They are considered safe to construct, but unsafe to use in any way that depends on the resource they point to.
This library is meant to be a building block for higher-level libraries, such as the io-streams crate.
The central type of this library is
UnsafeHandle. On Posix-ish platforms
it just contains a
RawFd. On Windows, it contains an enum of either a
RawHandle (for files and pipes), a
RawSocket (for sockets), or a stdio
handle (for stdin, stdout, stderr), allowing it to abstract over different
types of I/O in a similar manner.
The crate documentation has a complete overview and examples.