about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-05-19 20:49:42 -0700
committerbors <bors@rust-lang.org>2013-05-19 20:49:42 -0700
commit0b39bc275e8f573238ad23fc8f86c87cec5e103d (patch)
tree1f7a52e76de3eede04fe4d0f3977a76300e1bff6
parentcab9249c62d5f33b3ae625970c05231341d2f95e (diff)
parent91d3e7f1a0757bf314ab3a4c4be8f910e2355d35 (diff)
downloadrust-0b39bc275e8f573238ad23fc8f86c87cec5e103d.tar.gz
rust-0b39bc275e8f573238ad23fc8f86c87cec5e103d.zip
auto merge of #6624 : steveklabnik/rust/io_prelude, r=catamorphism
Let's actually give a top-level description of what's in here, eh?
-rw-r--r--src/libcore/io.rs32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/libcore/io.rs b/src/libcore/io.rs
index 2e37c6766c6..7d76d8d30cd 100644
--- a/src/libcore/io.rs
+++ b/src/libcore/io.rs
@@ -10,7 +10,37 @@
 
 /*!
 
-Basic input/output
+The `io` module contains basic input and output routines.
+
+A quick summary:
+
+## `Reader` and `Writer` traits
+
+These traits define the minimal set of methods that anything that can do
+input and output should implement.
+
+## `ReaderUtil` and `WriterUtil` traits
+
+Richer methods that allow you to do more. `Reader` only lets you read a certain
+number of bytes into a buffer, while `ReaderUtil` allows you to read a whole
+line, for example.
+
+Generally, these richer methods are probably the ones you want to actually
+use in day-to-day Rust.
+
+Furthermore, because there is an implementation of `ReaderUtil` for
+`<T: Reader>`, when your input or output code implements `Reader`, you get
+all of these methods for free.
+
+## `print` and `println`
+
+These very useful functions are defined here. You generally don't need to
+import them, though, as the prelude already does.
+
+## `stdin`, `stdout`, and `stderr`
+
+These functions return references to the classic three file descriptors. They
+implement `Reader` and `Writer`, where appropriate.
 
 */