We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e4895d3 commit 2cbb9d2Copy full SHA for 2cbb9d2
changelog/2608.added.md
@@ -0,0 +1 @@
1
+Added `From<std::net::Shutdown>` implementation for `sys::socket::Shutdown`.
src/sys/socket/mod.rs
@@ -2545,6 +2545,17 @@ pub enum Shutdown {
2545
Both,
2546
}
2547
2548
+#[cfg(feature = "net")]
2549
+impl From<net::Shutdown> for Shutdown {
2550
+ fn from(value: net::Shutdown) -> Self {
2551
+ match value {
2552
+ net::Shutdown::Read => Shutdown::Read,
2553
+ net::Shutdown::Write => Shutdown::Write,
2554
+ net::Shutdown::Both => Shutdown::Both,
2555
+ }
2556
2557
+}
2558
+
2559
/// Shut down part of a full-duplex connection.
2560
///
2561
/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/shutdown.html)
0 commit comments