about summary refs log tree commit diff
path: root/library/std/src/sys/unix/pipe.rs
diff options
context:
space:
mode:
authorAyush Singh <ayushsingh1325@gmail.com>2022-12-08 18:12:15 +0530
committerAyush Singh <ayushsingh1325@gmail.com>2022-12-08 18:12:15 +0530
commit5479fe5f70bb32f037ff97de03ed185bdf2f54b7 (patch)
treefdc635e201ef6e372a3b30ea7e825a61ca9fef56 /library/std/src/sys/unix/pipe.rs
parentf5418b09e84883c4de2e652a147ab9faff4eee29 (diff)
downloadrust-5479fe5f70bb32f037ff97de03ed185bdf2f54b7.tar.gz
rust-5479fe5f70bb32f037ff97de03ed185bdf2f54b7.zip
Add read_to_end for AnonPipe
Add `read_to_end` method for `sys::{target}::pipe::AnonPipe`. This allows
having a more optimized version of `read_to_end` for ChildStdout.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
Diffstat (limited to 'library/std/src/sys/unix/pipe.rs')
-rw-r--r--library/std/src/sys/unix/pipe.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/std/src/sys/unix/pipe.rs b/library/std/src/sys/unix/pipe.rs
index a56c275c942..a744d0ab640 100644
--- a/library/std/src/sys/unix/pipe.rs
+++ b/library/std/src/sys/unix/pipe.rs
@@ -58,6 +58,10 @@ impl AnonPipe {
         self.0.is_read_vectored()
     }
 
+    pub fn read_to_end(&self, buf: &mut Vec<u8>) -> io::Result<usize> {
+        self.0.read_to_end(buf)
+    }
+
     pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
         self.0.write(buf)
     }