@@ -114,25 +114,29 @@ pub trait Reader {
114
114
115
115
// FIXME (#2982): This should probably return an error.
116
116
/**
117
- * Reads bytes and puts them into `bytes`. Returns the number of
118
- * bytes read.
117
+ * Reads bytes and puts them into `bytes`, advancing the cursor. Returns the
118
+ * number of bytes read.
119
119
*
120
120
* The number of bytes to be read is `len` or the end of the file,
121
121
* whichever comes first.
122
122
*
123
123
* The buffer must be at least `len` bytes long.
124
124
*
125
+ * `read` is conceptually similar to C's `fread` function.
126
+ *
125
127
* # Examples
126
128
*
127
129
* None right now.
128
130
*/
129
131
fn read ( & self , bytes : & mut [ u8 ] , len : uint ) -> uint ;
130
132
131
133
/**
132
- * Reads a single byte.
134
+ * Reads a single byte, advancing the cursor .
133
135
*
134
136
* In the case of an EOF or an error, returns a negative value.
135
137
*
138
+ * `read_byte` is conceptually similar to C's `getc` function.
139
+ *
136
140
* # Examples
137
141
*
138
142
* None right now.
@@ -142,6 +146,8 @@ pub trait Reader {
142
146
/**
143
147
* Returns a boolean value: are we currently at EOF?
144
148
*
149
+ * `eof` is conceptually similar to C's `feof` function.
150
+ *
145
151
* # Examples
146
152
*
147
153
* None right now.
@@ -154,6 +160,8 @@ pub trait Reader {
154
160
* Takes an optional SeekStyle, which affects how we seek from the
155
161
* position. See `SeekStyle` docs for more details.
156
162
*
163
+ * `seek` is conceptually similar to C's `fseek` function.
164
+ *
157
165
* # Examples
158
166
*
159
167
* None right now.
@@ -163,6 +171,8 @@ pub trait Reader {
163
171
/**
164
172
* Returns the current position within the stream.
165
173
*
174
+ * `tell` is conceptually similar to C's `ftell` function.
175
+ *
166
176
* # Examples
167
177
*
168
178
* None right now.
0 commit comments