Skip to content

Commit 8decea5

Browse files
authored
feat(driver,iocp): impl AsFd for borrowed handle (#694)
1 parent 3c3939f commit 8decea5

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

  • compio-driver/src/sys/iocp

compio-driver/src/sys/iocp/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,12 @@ impl AsFd for OwnedHandle {
228228
}
229229
}
230230

231+
impl AsFd for BorrowedHandle<'_> {
232+
fn as_fd(&self) -> BorrowedFd<'_> {
233+
(*self).into()
234+
}
235+
}
236+
231237
impl AsFd for socket2::Socket {
232238
fn as_fd(&self) -> BorrowedFd<'_> {
233239
self.as_socket().into()
@@ -240,6 +246,12 @@ impl AsFd for OwnedSocket {
240246
}
241247
}
242248

249+
impl AsFd for BorrowedSocket<'_> {
250+
fn as_fd(&self) -> BorrowedFd<'_> {
251+
(*self).into()
252+
}
253+
}
254+
243255
impl AsFd for std::process::ChildStdin {
244256
fn as_fd(&self) -> BorrowedFd<'_> {
245257
self.as_handle().into()

0 commit comments

Comments
 (0)