forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#98368 - sunfishcode:sunfishcode/std-os-fd, …
…r=joshtriplett 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` r? ``````@joshtriplett``````
- Loading branch information
Showing
10 changed files
with
25 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
//! Owned and borrowed Unix-like file descriptors. | ||
//! | ||
//! This module is supported on Unix platforms and WASI, which both 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. | ||
#[unstable(feature = "os_fd", issue = "98699")] | ||
pub use owned::*; | ||
#[unstable(feature = "os_fd", issue = "98699")] | ||
pub use raw::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
//! WASI-specific extensions to general I/O primitives. | ||
#![deny(unsafe_op_in_unsafe_fn)] | ||
#![unstable(feature = "wasi_ext", issue = "71213")] | ||
|
||
mod fd; | ||
mod raw; | ||
|
||
#[unstable(feature = "wasi_ext", issue = "71213")] | ||
pub use fd::*; | ||
#[unstable(feature = "wasi_ext", issue = "71213")] | ||
pub use raw::*; | ||
pub use crate::os::fd::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters