Skip to content
Open
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
10 changes: 9 additions & 1 deletion src/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
io::{Error, Result},
mem,
os::{
fd::{AsFd, BorrowedFd, FromRawFd},
fd::{AsFd, BorrowedFd, FromRawFd, IntoRawFd},
unix::io::{AsRawFd, RawFd},
},
};
Expand Down Expand Up @@ -69,6 +69,14 @@ impl AsFd for Socket {
}
}

impl IntoRawFd for Socket {
fn into_raw_fd(self) -> RawFd {
let fd = self.0;
std::mem::forget(self);
fd
}
}
Comment thread
WGH- marked this conversation as resolved.

impl FromRawFd for Socket {
unsafe fn from_raw_fd(fd: RawFd) -> Self {
Socket(fd)
Expand Down