io_extras/os/
rustix.rs

1//! All Posix-ish platforms have `RawFd` and related traits. Re-export them
2//! so that users don't need target-specific code to import them.
3
4#[cfg(unix)]
5pub use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
6#[cfg(target_os = "wasi")]
7pub use std::os::wasi::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
8
9pub use crate::read_write::{AsRawReadWriteFd, AsReadWriteFd};
10
11// In theory we could do something similar for
12// `std::os::fortanix_sgx::io::{AsRawFd, FromRawFd, RawFd}`, however it lacks
13// `IntoRawFd`, and `std::fs::File` doesn't implement its `AsRawFd`, so it
14// doesn't seem to qualify as Posix-ish.