@@ -96,7 +96,20 @@ impl Read for StdinRaw {
96
96
unsafe fn initializer ( & self ) -> Initializer {
97
97
Initializer :: nop ( )
98
98
}
99
+
100
+ fn read_to_end ( & mut self , buf : & mut Vec < u8 > ) -> io:: Result < usize > {
101
+ self . 0 . read_to_end ( buf)
102
+ }
103
+
104
+ fn read_to_string ( & mut self , buf : & mut String ) -> io:: Result < usize > {
105
+ self . 0 . read_to_string ( buf)
106
+ }
107
+
108
+ fn read_exact ( & mut self , buf : & mut [ u8 ] ) -> io:: Result < ( ) > {
109
+ self . 0 . read_exact ( buf)
110
+ }
99
111
}
112
+
100
113
impl Write for StdoutRaw {
101
114
fn write ( & mut self , buf : & [ u8 ] ) -> io:: Result < usize > {
102
115
self . 0 . write ( buf)
@@ -114,7 +127,20 @@ impl Write for StdoutRaw {
114
127
fn flush ( & mut self ) -> io:: Result < ( ) > {
115
128
self . 0 . flush ( )
116
129
}
130
+
131
+ fn write_all ( & mut self , buf : & [ u8 ] ) -> io:: Result < ( ) > {
132
+ self . 0 . write_all ( buf)
133
+ }
134
+
135
+ fn write_all_vectored ( & mut self , bufs : & mut [ IoSlice < ' _ > ] ) -> io:: Result < ( ) > {
136
+ self . 0 . write_all_vectored ( bufs)
137
+ }
138
+
139
+ fn write_fmt ( & mut self , fmt : fmt:: Arguments < ' _ > ) -> io:: Result < ( ) > {
140
+ self . 0 . write_fmt ( fmt)
141
+ }
117
142
}
143
+
118
144
impl Write for StderrRaw {
119
145
fn write ( & mut self , buf : & [ u8 ] ) -> io:: Result < usize > {
120
146
self . 0 . write ( buf)
@@ -132,6 +158,18 @@ impl Write for StderrRaw {
132
158
fn flush ( & mut self ) -> io:: Result < ( ) > {
133
159
self . 0 . flush ( )
134
160
}
161
+
162
+ fn write_all ( & mut self , buf : & [ u8 ] ) -> io:: Result < ( ) > {
163
+ self . 0 . write_all ( buf)
164
+ }
165
+
166
+ fn write_all_vectored ( & mut self , bufs : & mut [ IoSlice < ' _ > ] ) -> io:: Result < ( ) > {
167
+ self . 0 . write_all_vectored ( bufs)
168
+ }
169
+
170
+ fn write_fmt ( & mut self , fmt : fmt:: Arguments < ' _ > ) -> io:: Result < ( ) > {
171
+ self . 0 . write_fmt ( fmt)
172
+ }
135
173
}
136
174
137
175
enum Maybe < T > {
@@ -420,16 +458,37 @@ impl Read for StdinLock<'_> {
420
458
unsafe fn initializer ( & self ) -> Initializer {
421
459
Initializer :: nop ( )
422
460
}
461
+
462
+ fn read_to_end ( & mut self , buf : & mut Vec < u8 > ) -> io:: Result < usize > {
463
+ self . inner . read_to_end ( buf)
464
+ }
465
+
466
+ fn read_to_string ( & mut self , buf : & mut String ) -> io:: Result < usize > {
467
+ self . inner . read_to_string ( buf)
468
+ }
469
+
470
+ fn read_exact ( & mut self , buf : & mut [ u8 ] ) -> io:: Result < ( ) > {
471
+ self . inner . read_exact ( buf)
472
+ }
423
473
}
424
474
425
475
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
426
476
impl BufRead for StdinLock < ' _ > {
427
477
fn fill_buf ( & mut self ) -> io:: Result < & [ u8 ] > {
428
478
self . inner . fill_buf ( )
429
479
}
480
+
430
481
fn consume ( & mut self , n : usize ) {
431
482
self . inner . consume ( n)
432
483
}
484
+
485
+ fn read_until ( & mut self , byte : u8 , buf : & mut Vec < u8 > ) -> io:: Result < usize > {
486
+ self . inner . read_until ( byte, buf)
487
+ }
488
+
489
+ fn read_line ( & mut self , buf : & mut String ) -> io:: Result < usize > {
490
+ self . inner . read_line ( buf)
491
+ }
433
492
}
434
493
435
494
#[ stable( feature = "std_debug" , since = "1.16.0" ) ]
@@ -593,6 +652,9 @@ impl Write for Stdout {
593
652
fn write_all ( & mut self , buf : & [ u8 ] ) -> io:: Result < ( ) > {
594
653
self . lock ( ) . write_all ( buf)
595
654
}
655
+ fn write_all_vectored ( & mut self , bufs : & mut [ IoSlice < ' _ > ] ) -> io:: Result < ( ) > {
656
+ self . lock ( ) . write_all_vectored ( bufs)
657
+ }
596
658
fn write_fmt ( & mut self , args : fmt:: Arguments < ' _ > ) -> io:: Result < ( ) > {
597
659
self . lock ( ) . write_fmt ( args)
598
660
}
@@ -612,6 +674,12 @@ impl Write for StdoutLock<'_> {
612
674
fn flush ( & mut self ) -> io:: Result < ( ) > {
613
675
self . inner . borrow_mut ( ) . flush ( )
614
676
}
677
+ fn write_all ( & mut self , buf : & [ u8 ] ) -> io:: Result < ( ) > {
678
+ self . inner . borrow_mut ( ) . write_all ( buf)
679
+ }
680
+ fn write_all_vectored ( & mut self , bufs : & mut [ IoSlice < ' _ > ] ) -> io:: Result < ( ) > {
681
+ self . inner . borrow_mut ( ) . write_all_vectored ( bufs)
682
+ }
615
683
}
616
684
617
685
#[ stable( feature = "std_debug" , since = "1.16.0" ) ]
@@ -767,6 +835,9 @@ impl Write for Stderr {
767
835
fn write_all ( & mut self , buf : & [ u8 ] ) -> io:: Result < ( ) > {
768
836
self . lock ( ) . write_all ( buf)
769
837
}
838
+ fn write_all_vectored ( & mut self , bufs : & mut [ IoSlice < ' _ > ] ) -> io:: Result < ( ) > {
839
+ self . lock ( ) . write_all_vectored ( bufs)
840
+ }
770
841
fn write_fmt ( & mut self , args : fmt:: Arguments < ' _ > ) -> io:: Result < ( ) > {
771
842
self . lock ( ) . write_fmt ( args)
772
843
}
@@ -786,6 +857,12 @@ impl Write for StderrLock<'_> {
786
857
fn flush ( & mut self ) -> io:: Result < ( ) > {
787
858
self . inner . borrow_mut ( ) . flush ( )
788
859
}
860
+ fn write_all ( & mut self , buf : & [ u8 ] ) -> io:: Result < ( ) > {
861
+ self . inner . borrow_mut ( ) . write_all ( buf)
862
+ }
863
+ fn write_all_vectored ( & mut self , bufs : & mut [ IoSlice < ' _ > ] ) -> io:: Result < ( ) > {
864
+ self . inner . borrow_mut ( ) . write_all_vectored ( bufs)
865
+ }
789
866
}
790
867
791
868
#[ stable( feature = "std_debug" , since = "1.16.0" ) ]
0 commit comments