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 Jul 27, 2022
1 parent 9b9c500 commit 5fc5790
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/net/tcp/stream.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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 +58,10 @@ 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 5fc5790

Please sign in to comment.