File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -453,6 +453,32 @@ impl Read for Stdin {
453453 }
454454}
455455
456+ #[ stable( feature = "read_shared_stdin" , since = "CURRENT_RUSTC_VERSION" ) ]
457+ impl Read for & Stdin {
458+ fn read ( & mut self , buf : & mut [ u8 ] ) -> io:: Result < usize > {
459+ self . lock ( ) . read ( buf)
460+ }
461+ fn read_buf ( & mut self , buf : BorrowedCursor < ' _ > ) -> io:: Result < ( ) > {
462+ self . lock ( ) . read_buf ( buf)
463+ }
464+ fn read_vectored ( & mut self , bufs : & mut [ IoSliceMut < ' _ > ] ) -> io:: Result < usize > {
465+ self . lock ( ) . read_vectored ( bufs)
466+ }
467+ #[ inline]
468+ fn is_read_vectored ( & self ) -> bool {
469+ self . lock ( ) . is_read_vectored ( )
470+ }
471+ fn read_to_end ( & mut self , buf : & mut Vec < u8 > ) -> io:: Result < usize > {
472+ self . lock ( ) . read_to_end ( buf)
473+ }
474+ fn read_to_string ( & mut self , buf : & mut String ) -> io:: Result < usize > {
475+ self . lock ( ) . read_to_string ( buf)
476+ }
477+ fn read_exact ( & mut self , buf : & mut [ u8 ] ) -> io:: Result < ( ) > {
478+ self . lock ( ) . read_exact ( buf)
479+ }
480+ }
481+
456482// only used by platform-dependent io::copy specializations, i.e. unused on some platforms
457483#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
458484impl StdinLock < ' _ > {
You can’t perform that action at this time.
0 commit comments