Skip to content

Commit ab08639

Browse files
committed
Add comments about impls for File, TcpStream, ChildStdin, etc.
1 parent 68964a7 commit ab08639

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

Diff for: library/std/src/fs.rs

+6
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,12 @@ impl File {
587587
}
588588
}
589589

590+
// In addition to the `impl`s here, `File` also has `impl`s for
591+
// `AsFd`/`From<OwnedFd>`/`Into<OwnedFd>` and
592+
// `AsRawFd`/`IntoRawFd`/`FromRawFd`, on Unix and WASI, and
593+
// `AsHandle`/`From<OwnedHandle>`/`Into<OwnedHandle>` and
594+
// `AsRawHandle`/`IntoRawHandle`/`FromRawHandle` on Windows.
595+
590596
impl AsInner<fs_imp::File> for File {
591597
fn as_inner(&self) -> &fs_imp::File {
592598
&self.inner

Diff for: library/std/src/net/tcp.rs

+12
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,12 @@ impl TcpStream {
546546
}
547547
}
548548

549+
// In addition to the `impl`s here, `TcpStream` also has `impl`s for
550+
// `AsFd`/`From<OwnedFd>`/`Into<OwnedFd>` and
551+
// `AsRawFd`/`IntoRawFd`/`FromRawFd`, on Unix and WASI, and
552+
// `AsSocket`/`From<OwnedSocket>`/`Into<OwnedSocket>` and
553+
// `AsRawSocket`/`IntoRawSocket`/`FromRawSocket` on Windows.
554+
549555
#[stable(feature = "rust1", since = "1.0.0")]
550556
impl Read for TcpStream {
551557
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
@@ -908,6 +914,12 @@ impl TcpListener {
908914
}
909915
}
910916

917+
// In addition to the `impl`s here, `TcpListener` also has `impl`s for
918+
// `AsFd`/`From<OwnedFd>`/`Into<OwnedFd>` and
919+
// `AsRawFd`/`IntoRawFd`/`FromRawFd`, on Unix and WASI, and
920+
// `AsSocket`/`From<OwnedSocket>`/`Into<OwnedSocket>` and
921+
// `AsRawSocket`/`IntoRawSocket`/`FromRawSocket` on Windows.
922+
911923
#[stable(feature = "rust1", since = "1.0.0")]
912924
impl<'a> Iterator for Incoming<'a> {
913925
type Item = io::Result<TcpStream>;

Diff for: library/std/src/net/udp.rs

+6
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,12 @@ impl UdpSocket {
779779
}
780780
}
781781

782+
// In addition to the `impl`s here, `UdpSocket` also has `impl`s for
783+
// `AsFd`/`From<OwnedFd>`/`Into<OwnedFd>` and
784+
// `AsRawFd`/`IntoRawFd`/`FromRawFd`, on Unix and WASI, and
785+
// `AsSocket`/`From<OwnedSocket>`/`Into<OwnedSocket>` and
786+
// `AsRawSocket`/`IntoRawSocket`/`FromRawSocket` on Windows.
787+
782788
impl AsInner<net_imp::UdpSocket> for UdpSocket {
783789
fn as_inner(&self) -> &net_imp::UdpSocket {
784790
&self.0

Diff for: library/std/src/process.rs

+18
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,12 @@ pub struct ChildStdin {
258258
inner: AnonPipe,
259259
}
260260

261+
// In addition to the `impl`s here, `ChildStdin` also has `impl`s for
262+
// `AsFd`/`From<OwnedFd>`/`Into<OwnedFd>` and
263+
// `AsRawFd`/`IntoRawFd`/`FromRawFd`, on Unix and WASI, and
264+
// `AsHandle`/`From<OwnedHandle>`/`Into<OwnedHandle>` and
265+
// `AsRawHandle`/`IntoRawHandle`/`FromRawHandle` on Windows.
266+
261267
#[stable(feature = "process", since = "1.0.0")]
262268
impl Write for ChildStdin {
263269
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
@@ -335,6 +341,12 @@ pub struct ChildStdout {
335341
inner: AnonPipe,
336342
}
337343

344+
// In addition to the `impl`s here, `ChildStdout` also has `impl`s for
345+
// `AsFd`/`From<OwnedFd>`/`Into<OwnedFd>` and
346+
// `AsRawFd`/`IntoRawFd`/`FromRawFd`, on Unix and WASI, and
347+
// `AsHandle`/`From<OwnedHandle>`/`Into<OwnedHandle>` and
348+
// `AsRawHandle`/`IntoRawHandle`/`FromRawHandle` on Windows.
349+
338350
#[stable(feature = "process", since = "1.0.0")]
339351
impl Read for ChildStdout {
340352
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
@@ -396,6 +408,12 @@ pub struct ChildStderr {
396408
inner: AnonPipe,
397409
}
398410

411+
// In addition to the `impl`s here, `ChildStderr` also has `impl`s for
412+
// `AsFd`/`From<OwnedFd>`/`Into<OwnedFd>` and
413+
// `AsRawFd`/`IntoRawFd`/`FromRawFd`, on Unix and WASI, and
414+
// `AsHandle`/`From<OwnedHandle>`/`Into<OwnedHandle>` and
415+
// `AsRawHandle`/`IntoRawHandle`/`FromRawHandle` on Windows.
416+
399417
#[stable(feature = "process", since = "1.0.0")]
400418
impl Read for ChildStderr {
401419
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {

0 commit comments

Comments
 (0)