diff options
| author | Dan Gohman <dev@sunfishcode.online> | 2022-06-14 10:44:14 -0700 |
|---|---|---|
| committer | Dan Gohman <dev@sunfishcode.online> | 2022-08-29 08:31:40 -0700 |
| commit | c846a2af8ddaa14ff2c2da25bc97bbd8d4284df2 (patch) | |
| tree | 64395199d0e913db21fdd1148b19df97ad5e37c4 /library/std/src/os/fd/mod.rs | |
| parent | b96fa1a25ced4cfa72923e6d45f47f36c2c00ce0 (diff) | |
| download | rust-c846a2af8ddaa14ff2c2da25bc97bbd8d4284df2.tar.gz rust-c846a2af8ddaa14ff2c2da25bc97bbd8d4284df2.zip | |
Make `std::os::fd` public.
`std::os::fd` defines types like `OwnedFd` and `RawFd` and is common between Unix and non-Unix platforms that share a basic file-descriptor concept. Rust currently uses this internally to simplify its own code, but it would be useful for external users in the same way, so make it public. This means that `OwnedFd` etc. will all appear in three places, for example on unix platforms: - `std::os::fd::OwnedFd` - `std::os::unix::io::OwnedFd` - `std::os::unix::prelude::OwnedFd`
Diffstat (limited to 'library/std/src/os/fd/mod.rs')
| -rw-r--r-- | library/std/src/os/fd/mod.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/library/std/src/os/fd/mod.rs b/library/std/src/os/fd/mod.rs index a456947534a..8043d1a53d2 100644 --- a/library/std/src/os/fd/mod.rs +++ b/library/std/src/os/fd/mod.rs @@ -1,16 +1,26 @@ //! Owned and borrowed Unix-like file descriptors. +//! +//! This module is supported on Unix platforms, and also some non-Unix +//! platforms which use a similar file descriptor system for referencing OS +//! resources. #![stable(feature = "io_safety", since = "1.63.0")] #![deny(unsafe_op_in_unsafe_fn)] // `RawFd`, `AsRawFd`, etc. -pub mod raw; +mod raw; // `OwnedFd`, `AsFd`, etc. -pub mod owned; +mod owned; // Implementations for `AsRawFd` etc. for network types. mod net; #[cfg(test)] mod tests; + +// Export the types and traits for the public API. +#[stable(feature = "io_safety", since = "1.63.0")] +pub use owned::*; +#[stable(feature = "rust1", since = "1.0.0")] +pub use raw::*; |
