Skip to content

Commit 4abd4fa

Browse files
committed
Implement conversion from std::net::Shutdown
1 parent e4895d3 commit 4abd4fa

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/sys/socket/mod.rs

+11
Original file line numberDiff line numberDiff line change
@@ -2545,6 +2545,17 @@ pub enum Shutdown {
25452545
Both,
25462546
}
25472547

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+
25482559
/// Shut down part of a full-duplex connection.
25492560
///
25502561
/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/shutdown.html)

0 commit comments

Comments
 (0)