Skip to content

Commit 0b39bc2

Browse files
committed
auto merge of #6624 : steveklabnik/rust/io_prelude, r=catamorphism
Let's actually give a top-level description of what's in here, eh?
2 parents cab9249 + 91d3e7f commit 0b39bc2

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

src/libcore/io.rs

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,37 @@
1010

1111
/*!
1212
13-
Basic input/output
13+
The `io` module contains basic input and output routines.
14+
15+
A quick summary:
16+
17+
## `Reader` and `Writer` traits
18+
19+
These traits define the minimal set of methods that anything that can do
20+
input and output should implement.
21+
22+
## `ReaderUtil` and `WriterUtil` traits
23+
24+
Richer methods that allow you to do more. `Reader` only lets you read a certain
25+
number of bytes into a buffer, while `ReaderUtil` allows you to read a whole
26+
line, for example.
27+
28+
Generally, these richer methods are probably the ones you want to actually
29+
use in day-to-day Rust.
30+
31+
Furthermore, because there is an implementation of `ReaderUtil` for
32+
`<T: Reader>`, when your input or output code implements `Reader`, you get
33+
all of these methods for free.
34+
35+
## `print` and `println`
36+
37+
These very useful functions are defined here. You generally don't need to
38+
import them, though, as the prelude already does.
39+
40+
## `stdin`, `stdout`, and `stderr`
41+
42+
These functions return references to the classic three file descriptors. They
43+
implement `Reader` and `Writer`, where appropriate.
1444
1545
*/
1646

0 commit comments

Comments
 (0)