From b7a8876e0bb78e772b1377ee73fd9111aa70b02a Mon Sep 17 00:00:00 2001 From: Matthew Helkey Date: Wed, 28 Oct 2026 15:41:44 +0000 Subject: [PATCH 1/2] std: stabilize windows_unix_domain_sockets --- library/std/src/os/windows/mod.rs | 2 +- library/std/src/os/windows/net/addr.rs | 6 +----- library/std/src/os/windows/net/listener.rs | 12 +----------- library/std/src/os/windows/net/stream.rs | 17 +---------------- library/std/tests/windows_unix_socket.rs | 1 - 5 files changed, 4 insertions(+), 34 deletions(-) diff --git a/library/std/src/os/windows/mod.rs b/library/std/src/os/windows/mod.rs index 507d14765e3fa..47571d99a97c6 100644 --- a/library/std/src/os/windows/mod.rs +++ b/library/std/src/os/windows/mod.rs @@ -30,7 +30,7 @@ pub mod ffi; pub mod fs; pub mod io; -#[unstable(feature = "windows_unix_domain_sockets", issue = "150487")] +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub mod net; pub mod process; pub mod raw; diff --git a/library/std/src/os/windows/net/addr.rs b/library/std/src/os/windows/net/addr.rs index 5f6b93e56e723..52ddb9e1911c8 100644 --- a/library/std/src/os/windows/net/addr.rs +++ b/library/std/src/os/windows/net/addr.rs @@ -1,4 +1,4 @@ -#![unstable(feature = "windows_unix_domain_sockets", issue = "150487")] +#![stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] use crate::byte_str::ByteStr; use crate::ffi::OsStr; use crate::path::Path; @@ -81,7 +81,6 @@ impl SocketAddr { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixListener; /// use std::path::Path; /// @@ -107,7 +106,6 @@ impl SocketAddr { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::SocketAddr; /// use std::path::Path; /// @@ -122,7 +120,6 @@ impl SocketAddr { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::SocketAddr; /// /// assert!(SocketAddr::from_pathname("/path/with/\0/bytes").is_err()); @@ -156,7 +153,6 @@ impl SocketAddr { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixListener; /// /// fn main() -> std::io::Result<()> { diff --git a/library/std/src/os/windows/net/listener.rs b/library/std/src/os/windows/net/listener.rs index 19f5254e08bf9..e671859bc65a3 100644 --- a/library/std/src/os/windows/net/listener.rs +++ b/library/std/src/os/windows/net/listener.rs @@ -1,4 +1,4 @@ -#![unstable(feature = "windows_unix_domain_sockets", issue = "150487")] +#![stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] use crate::os::windows::io::{AsRawSocket, FromRawSocket, IntoRawSocket, RawSocket}; use crate::os::windows::net::{SocketAddr, UnixStream}; use crate::path::Path; @@ -18,7 +18,6 @@ use crate::{fmt, io}; /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] -/// #![feature(windows_unix_domain_sockets)] /// use std::thread; /// use std::os::windows::net::{UnixStream, UnixListener}; /// @@ -64,7 +63,6 @@ impl UnixListener { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixListener; /// /// let listener = match UnixListener::bind("/path/to/the/socket") { @@ -88,7 +86,6 @@ impl UnixListener { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::{UnixListener}; /// /// fn main() -> std::io::Result<()> { @@ -127,7 +124,6 @@ impl UnixListener { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixListener; /// /// fn main() -> std::io::Result<()> { @@ -154,7 +150,6 @@ impl UnixListener { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixListener; /// /// fn main() -> std::io::Result<()> { @@ -177,7 +172,6 @@ impl UnixListener { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixListener; /// /// fn main() -> std::io::Result<()> { @@ -202,7 +196,6 @@ impl UnixListener { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixListener; /// /// fn main() -> std::io::Result<()> { @@ -221,7 +214,6 @@ impl UnixListener { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixListener; /// /// fn main() -> std::io::Result<()> { @@ -246,7 +238,6 @@ impl UnixListener { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::thread; /// use std::os::windows::net::{UnixStream, UnixListener}; /// @@ -283,7 +274,6 @@ impl UnixListener { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] -/// #![feature(windows_unix_domain_sockets)] /// use std::thread; /// use std::os::windows::net::{UnixStream, UnixListener}; /// diff --git a/library/std/src/os/windows/net/stream.rs b/library/std/src/os/windows/net/stream.rs index c0f32e75411e9..30d5df49da3fd 100644 --- a/library/std/src/os/windows/net/stream.rs +++ b/library/std/src/os/windows/net/stream.rs @@ -1,4 +1,4 @@ -#![unstable(feature = "windows_unix_domain_sockets", issue = "150487")] +#![stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] use crate::net::Shutdown; use crate::os::windows::io::{ AsRawSocket, AsSocket, BorrowedSocket, FromRawSocket, IntoRawSocket, RawSocket, @@ -23,7 +23,6 @@ use crate::{fmt, io}; /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] -/// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// use std::io::prelude::*; /// @@ -57,7 +56,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// /// let socket = match UnixStream::connect("/tmp/sock") { @@ -81,7 +79,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::{UnixListener, UnixStream}; /// /// fn main() -> std::io::Result<()> { @@ -117,7 +114,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// /// fn main() -> std::io::Result<()> { @@ -136,7 +132,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// /// fn main() -> std::io::Result<()> { @@ -155,7 +150,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// use std::time::Duration; /// @@ -176,7 +170,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// /// fn main() -> std::io::Result<()> { @@ -201,7 +194,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// use std::time::Duration; /// @@ -217,7 +209,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::io; /// use std::os::windows::net::UnixStream; /// use std::time::Duration; @@ -246,7 +237,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// use std::time::Duration; /// @@ -263,7 +253,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::io; /// use std::os::windows::net::UnixStream; /// use std::time::Duration; @@ -290,7 +279,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// use std::net::Shutdown; /// @@ -310,7 +298,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// /// fn main() -> std::io::Result<()> { @@ -336,7 +323,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// /// fn main() -> std::io::Result<()> { @@ -355,7 +341,6 @@ impl UnixStream { /// #[cfg_attr(windows, doc = "```no_run")] #[cfg_attr(not(windows), doc = "```ignore (needs windows)")] - /// #![feature(windows_unix_domain_sockets)] /// use std::os::windows::net::UnixStream; /// use std::time::Duration; /// diff --git a/library/std/tests/windows_unix_socket.rs b/library/std/tests/windows_unix_socket.rs index dd71b1f135dce..9a240b27635fd 100644 --- a/library/std/tests/windows_unix_socket.rs +++ b/library/std/tests/windows_unix_socket.rs @@ -1,6 +1,5 @@ #![cfg(windows)] #![cfg(not(miri))] // no Windows socket support in Miri -#![feature(windows_unix_domain_sockets)] // Now only test windows_unix_domain_sockets feature // in the future, will test both unix and windows uds use std::io::{Read, Write}; From 6bd95c44869e5481093c57113e0161031e233134 Mon Sep 17 00:00:00 2001 From: Matthew Helkey Date: Wed, 28 Oct 2026 16:22:39 +0000 Subject: [PATCH 2/2] fix: add stability tags --- library/std/src/os/windows/net/addr.rs | 7 ++++++- library/std/src/os/windows/net/listener.rs | 16 ++++++++++++++++ library/std/src/os/windows/net/mod.rs | 3 +++ library/std/src/os/windows/net/stream.rs | 22 ++++++++++++++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) diff --git a/library/std/src/os/windows/net/addr.rs b/library/std/src/os/windows/net/addr.rs index 52ddb9e1911c8..9341eae3f6ca1 100644 --- a/library/std/src/os/windows/net/addr.rs +++ b/library/std/src/os/windows/net/addr.rs @@ -8,7 +8,7 @@ use crate::sys::cvt_nz; use crate::{fmt, io, mem, ptr}; #[cfg(not(doc))] -pub fn sockaddr_un(path: &Path) -> io::Result<(SOCKADDR_UN, usize)> { +pub(super) fn sockaddr_un(path: &Path) -> io::Result<(SOCKADDR_UN, usize)> { // SAFETY: All zeros is a valid representation for `sockaddr_un`. let mut addr: SOCKADDR_UN = unsafe { mem::zeroed() }; addr.sun_family = AF_UNIX; @@ -34,11 +34,13 @@ pub fn sockaddr_un(path: &Path) -> io::Result<(SOCKADDR_UN, usize)> { } #[cfg(not(doc))] const SUN_PATH_OFFSET: usize = mem::offset_of!(SOCKADDR_UN, sun_path); +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub struct SocketAddr { #[cfg(not(doc))] pub(super) addr: SOCKADDR_UN, pub(super) len: u32, // Use u32 here as same as libc::socklen_t } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl fmt::Debug for SocketAddr { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { match self.address() { @@ -91,6 +93,7 @@ impl SocketAddr { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn as_pathname(&self) -> Option<&Path> { if let AddressKind::Pathname(path) = self.address() { Some(path) } else { None } } @@ -124,6 +127,7 @@ impl SocketAddr { /// /// assert!(SocketAddr::from_pathname("/path/with/\0/bytes").is_err()); /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn from_pathname

(path: P) -> io::Result where P: AsRef, @@ -162,6 +166,7 @@ impl SocketAddr { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn is_unnamed(&self) -> bool { matches!(self.address(), AddressKind::Unnamed) } diff --git a/library/std/src/os/windows/net/listener.rs b/library/std/src/os/windows/net/listener.rs index e671859bc65a3..821d0dc555b0e 100644 --- a/library/std/src/os/windows/net/listener.rs +++ b/library/std/src/os/windows/net/listener.rs @@ -44,8 +44,10 @@ use crate::{fmt, io}; /// Ok(()) /// } /// ``` +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub struct UnixListener(Socket); +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl fmt::Debug for UnixListener { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { let mut builder = fmt.debug_struct("UnixListener"); @@ -73,6 +75,7 @@ impl UnixListener { /// } /// }; /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn bind>(path: P) -> io::Result { let socket_addr = SocketAddr::from_pathname(path)?; Self::bind_addr(&socket_addr) @@ -102,6 +105,7 @@ impl UnixListener { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn bind_addr(socket_addr: &SocketAddr) -> io::Result { startup(); let inner = Socket::new(AF_UNIX as _, SOCK_STREAM)?; @@ -136,6 +140,7 @@ impl UnixListener { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn accept(&self) -> io::Result<(UnixStream, SocketAddr)> { let mut storage = SOCKADDR_UN::default(); let mut len = size_of::() as _; @@ -158,6 +163,7 @@ impl UnixListener { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn local_addr(&self) -> io::Result { SocketAddr::new(|addr, len| unsafe { getsockname(self.0.as_raw(), addr, len) }) } @@ -180,6 +186,7 @@ impl UnixListener { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn try_clone(&self) -> io::Result { self.0.duplicate().map(UnixListener) } @@ -204,6 +211,7 @@ impl UnixListener { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { self.0.set_nonblocking(nonblocking) } @@ -225,6 +233,7 @@ impl UnixListener { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn take_error(&self) -> io::Result> { self.0.take_error() } @@ -261,6 +270,7 @@ impl UnixListener { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn incoming(&self) -> Incoming<'_> { Incoming { listener: self } } @@ -297,10 +307,12 @@ impl UnixListener { /// Ok(()) /// } /// ``` +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub struct Incoming<'a> { listener: &'a UnixListener, } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl<'a> Iterator for Incoming<'a> { type Item = io::Result; @@ -313,6 +325,7 @@ impl<'a> Iterator for Incoming<'a> { } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl AsRawSocket for UnixListener { #[inline] fn as_raw_socket(&self) -> RawSocket { @@ -320,6 +333,7 @@ impl AsRawSocket for UnixListener { } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl FromRawSocket for UnixListener { #[inline] unsafe fn from_raw_socket(sock: RawSocket) -> Self { @@ -327,6 +341,7 @@ impl FromRawSocket for UnixListener { } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl IntoRawSocket for UnixListener { #[inline] fn into_raw_socket(self) -> RawSocket { @@ -334,6 +349,7 @@ impl IntoRawSocket for UnixListener { } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl<'a> IntoIterator for &'a UnixListener { type Item = io::Result; type IntoIter = Incoming<'a>; diff --git a/library/std/src/os/windows/net/mod.rs b/library/std/src/os/windows/net/mod.rs index 6b3f062b8ab41..8d3b99368f969 100644 --- a/library/std/src/os/windows/net/mod.rs +++ b/library/std/src/os/windows/net/mod.rs @@ -1,6 +1,9 @@ mod addr; mod listener; mod stream; +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub use addr::*; +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub use listener::*; +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub use stream::*; diff --git a/library/std/src/os/windows/net/stream.rs b/library/std/src/os/windows/net/stream.rs index 30d5df49da3fd..b23b21832c32c 100644 --- a/library/std/src/os/windows/net/stream.rs +++ b/library/std/src/os/windows/net/stream.rs @@ -35,7 +35,9 @@ use crate::{fmt, io}; /// Ok(()) /// } /// ``` +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub struct UnixStream(pub(super) Socket); +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl fmt::Debug for UnixStream { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { let mut builder = fmt.debug_struct("UnixStream"); @@ -66,6 +68,7 @@ impl UnixStream { /// } /// }; /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn connect>(path: P) -> io::Result { let socket_addr = SocketAddr::from_pathname(path)?; Self::connect_addr(&socket_addr) @@ -95,6 +98,7 @@ impl UnixStream { /// Ok(()) /// } /// ```` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn connect_addr(socket_addr: &SocketAddr) -> io::Result { startup(); let inner = Socket::new(AF_UNIX as _, SOCK_STREAM)?; @@ -122,6 +126,7 @@ impl UnixStream { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn local_addr(&self) -> io::Result { SocketAddr::new(|addr, len| unsafe { getsockname(self.0.as_raw(), addr, len) }) } @@ -140,6 +145,7 @@ impl UnixStream { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn peer_addr(&self) -> io::Result { SocketAddr::new(|addr, len| unsafe { getpeername(self.0.as_raw(), addr, len) }) } @@ -160,6 +166,7 @@ impl UnixStream { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn read_timeout(&self) -> io::Result> { self.0.timeout(SO_RCVTIMEO) } @@ -178,6 +185,7 @@ impl UnixStream { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { self.0.set_nonblocking(nonblocking) } @@ -221,6 +229,7 @@ impl UnixStream { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn set_read_timeout(&self, dur: Option) -> io::Result<()> { self.0.set_timeout(dur, SO_RCVTIMEO) } @@ -265,6 +274,7 @@ impl UnixStream { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn set_write_timeout(&self, dur: Option) -> io::Result<()> { self.0.set_timeout(dur, SO_SNDTIMEO) } @@ -288,6 +298,7 @@ impl UnixStream { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn shutdown(&self, how: Shutdown) -> io::Result<()> { self.0.shutdown(how) } @@ -308,6 +319,7 @@ impl UnixStream { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn take_error(&self) -> io::Result> { self.0.take_error() } @@ -331,6 +343,7 @@ impl UnixStream { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn try_clone(&self) -> io::Result { self.0.duplicate().map(UnixStream) } @@ -352,23 +365,27 @@ impl UnixStream { /// Ok(()) /// } /// ``` + #[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] pub fn write_timeout(&self) -> io::Result> { self.0.timeout(SO_SNDTIMEO) } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl io::Read for UnixStream { fn read(&mut self, buf: &mut [u8]) -> io::Result { io::Read::read(&mut &*self, buf) } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl<'a> io::Read for &'a UnixStream { fn read(&mut self, buf: &mut [u8]) -> io::Result { self.0.read(buf) } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl io::Write for UnixStream { fn write(&mut self, buf: &[u8]) -> io::Result { io::Write::write(&mut &*self, buf) @@ -378,6 +395,7 @@ impl io::Write for UnixStream { io::Write::flush(&mut &*self) } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl<'a> io::Write for &'a UnixStream { fn write(&mut self, buf: &[u8]) -> io::Result { self.write_vectored(&[io::IoSlice::new(buf)]) @@ -395,6 +413,7 @@ impl<'a> io::Write for &'a UnixStream { } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl AsSocket for UnixStream { #[inline] fn as_socket(&self) -> BorrowedSocket<'_> { @@ -402,6 +421,7 @@ impl AsSocket for UnixStream { } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl AsRawSocket for UnixStream { #[inline] fn as_raw_socket(&self) -> RawSocket { @@ -409,6 +429,7 @@ impl AsRawSocket for UnixStream { } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl FromRawSocket for UnixStream { #[inline] unsafe fn from_raw_socket(sock: RawSocket) -> Self { @@ -416,6 +437,7 @@ impl FromRawSocket for UnixStream { } } +#[stable(feature = "windows_unix_domain_sockets", since = "CURRENT_RUSTC_VERSION")] impl IntoRawSocket for UnixStream { fn into_raw_socket(self) -> RawSocket { self.0.into_raw_socket()