1//! Imports from `std` that would be polyfilled for `no_std` builds (see
2//! `src/polyfill/no_std`).
3//!
4//! This implementation is used when `std` is available and just imports the
5//! necessary items from `std`. For `no_std` builds, the file
6//! `src/polyfill/no_std` is used instead, which doesn't depend on the standard
7//! library.
89#[cfg(not(windows))]
10pub mod io {
11pub use std::io::{IoSlice, IoSliceMut};
12}
1314#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
15#[cfg(feature = "net")]
16pub mod net {
17pub use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
18}
1920pub mod os {
21pub mod fd {
22// Change to use `std::os::fd` when MSRV becomes 1.66 or higher.
2324#[cfg(target_os = "wasi")]
25pub use std::os::fd::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, OwnedFd, RawFd};
26#[cfg(unix)]
27pub use std::os::unix::io::{
28 AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, OwnedFd, RawFd,
29 };
30 }
3132#[cfg(windows)]
33pub mod windows {
34pub mod io {
35pub use std::os::windows::io::{
36 AsRawSocket, AsSocket, BorrowedSocket, FromRawSocket, IntoRawSocket, OwnedSocket,
37 RawSocket,
38 };
39 }
40 }
41}