Skip to content

Commit

Permalink
net: implement AsRawFd for TcpStream (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpc authored Aug 1, 2022
1 parent 89a9bd7 commit 0e323e9
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 0e323e9

Please sign in to comment.