Feature gate: #![feature(os_fd)]
This is a tracking issue for the std::os::fd module, which is currently defined on
both Unix and WASI , and contains OwnedFd, BorrowedFd, RawFd, AsFd,
AsRawFd, IntoRawFd, and FromRawFd.
Public API
The types and traits are the same as those already defined in std::os::unix::io
and std::os::wasi::io. This PR is just introducing a new alias for them to help
users write portable code.
// in std::os
#[cfg(any(unix, target_os = "wasi"))]
pub mod fd {
pub type RawFd = ...;
pub struct OwnedFd { ... }
pub struct BorrowedFd<'a> { ... }
pub trait AsFd { ... }
pub trait AsRawFd { ... }
pub trait IntoRawFd { ... }
pub trait FromRawFd { ... }
}
Steps / History
Unresolved Questions
- "fd" isn't literally an "os", yet this proposes having it as a public module under
std::os. One can think of it as meaning "OS's that use fds". Is that weird?
Feature gate:
#![feature(os_fd)]This is a tracking issue for the
std::os::fdmodule, which is currently defined onboth Unix and WASI , and contains
OwnedFd,BorrowedFd,RawFd,AsFd,AsRawFd,IntoRawFd, andFromRawFd.Public API
The types and traits are the same as those already defined in
std::os::unix::ioand
std::os::wasi::io. This PR is just introducing a new alias for them to helpusers write portable code.
Steps / History
std::os::fdpublic. #98368Unresolved Questions
std::os. One can think of it as meaning "OS's that use fds". Is that weird?