about summary refs log tree commit diff
path: root/library/std/src/sys/pal/unsupported/pipe.rs
diff options
context:
space:
mode:
authorJiahao XU <Jiahao_XU@outlook.com>2024-06-30 18:23:07 +1000
committerJiahao XU <Jiahao_XU@outlook.com>2024-07-23 23:13:56 +1000
commitc9c8a14884c19e51a0eee54ccd98efa7f0f2bddd (patch)
tree1b94b0d4990f0771508383ea979d012270473e53 /library/std/src/sys/pal/unsupported/pipe.rs
parent52f3c71c8dc4aaed71e3035995fcbdd6d78c98c6 (diff)
downloadrust-c9c8a14884c19e51a0eee54ccd98efa7f0f2bddd.tar.gz
rust-c9c8a14884c19e51a0eee54ccd98efa7f0f2bddd.zip
Initial implementation of anonymous_pipe
Co-authored-by: Alphyr <47725341+a1phyr@users.noreply.github.com>
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Diffstat (limited to 'library/std/src/sys/pal/unsupported/pipe.rs')
-rw-r--r--library/std/src/sys/pal/unsupported/pipe.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/library/std/src/sys/pal/unsupported/pipe.rs b/library/std/src/sys/pal/unsupported/pipe.rs
index d7d8f297ae5..781eafe2f1a 100644
--- a/library/std/src/sys/pal/unsupported/pipe.rs
+++ b/library/std/src/sys/pal/unsupported/pipe.rs
@@ -1,8 +1,21 @@
-use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut};
+use crate::{
+    fmt,
+    io::{self, BorrowedCursor, IoSlice, IoSliceMut},
+};
 
 pub struct AnonPipe(!);
 
+impl fmt::Debug for AnonPipe {
+    fn fmt(&self, _: &mut fmt::Formatter<'_>) -> fmt::Result {
+        self.0
+    }
+}
+
 impl AnonPipe {
+    pub fn try_clone(&self) -> io::Result<Self> {
+        self.0
+    }
+
     pub fn read(&self, _buf: &mut [u8]) -> io::Result<usize> {
         self.0
     }