Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/2608.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added `From<std::net::Shutdown>` implementation for `sys::socket::Shutdown`.
11 changes: 11 additions & 0 deletions src/sys/socket/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2545,6 +2545,17 @@ pub enum Shutdown {
Both,
}

#[cfg(feature = "net")]
impl From<net::Shutdown> for Shutdown {
fn from(value: net::Shutdown) -> Self {
match value {
net::Shutdown::Read => Shutdown::Read,
net::Shutdown::Write => Shutdown::Write,
net::Shutdown::Both => Shutdown::Both,
}
}
}

/// Shut down part of a full-duplex connection.
///
/// [Further reading](https://pubs.opengroup.org/onlinepubs/9699919799/functions/shutdown.html)
Expand Down
Loading