Skip to content

Commit

Permalink
Implement AsRawFd for TcpStream
Browse files Browse the repository at this point in the history
  • Loading branch information
dpc committed Aug 1, 2022
1 parent 9b9c500 commit 81faedd
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/net/tcp/stream.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
use std::{io, net::SocketAddr};
use std::{
io,
net::SocketAddr,
os::unix::prelude::{AsRawFd, RawFd},
};

use crate::{
buf::{IoBuf, IoBufMut},
Expand Down Expand Up @@ -58,3 +62,9 @@ impl TcpStream {
self.inner.write(buf).await
}
}

impl AsRawFd for TcpStream {
fn as_raw_fd(&self) -> RawFd {
self.inner.as_raw_fd()
}
}

0 comments on commit 81faedd

Please sign in to comment.