@@ -133,23 +133,30 @@ fn handle_ebadf<T>(r: io::Result<T>, default: T) -> io::Result<T> {
133
133
/// A handle to the standard input stream of a process.
134
134
///
135
135
/// Each handle is a shared reference to a global buffer of input data to this
136
- /// process. A handle can be `lock`'d to gain full access to `BufRead` methods
136
+ /// process. A handle can be `lock`'d to gain full access to [ `BufRead`] methods
137
137
/// (e.g. `.lines()`). Writes to this handle are otherwise locked with respect
138
138
/// to other writes.
139
139
///
140
140
/// This handle implements the `Read` trait, but beware that concurrent reads
141
141
/// of `Stdin` must be executed with care.
142
142
///
143
- /// Created by the function `io::stdin()`.
143
+ /// Created by the [`io::stdin`] method.
144
+ ///
145
+ /// [`io::stdin`]: fn.stdin.html
146
+ /// [`BufRead`]: trait.BufRead.html
144
147
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
145
148
pub struct Stdin {
146
149
inner : Arc < Mutex < BufReader < Maybe < StdinRaw > > > > ,
147
150
}
148
151
149
152
/// A locked reference to the `Stdin` handle.
150
153
///
151
- /// This handle implements both the `Read` and `BufRead` traits and is
152
- /// constructed via the `lock` method on `Stdin`.
154
+ /// This handle implements both the [`Read`] and [`BufRead`] traits, and
155
+ /// is constructed via the [`Stdin::lock`] method.
156
+ ///
157
+ /// [`Read`]: trait.Read.html
158
+ /// [`BufRead`]: trait.BufRead.html
159
+ /// [`Stdin::lock`]: struct.Stdin.html#method.lock
153
160
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
154
161
pub struct StdinLock < ' a > {
155
162
inner : MutexGuard < ' a , BufReader < Maybe < StdinRaw > > > ,
@@ -159,7 +166,7 @@ pub struct StdinLock<'a> {
159
166
///
160
167
/// Each handle returned is a reference to a shared global buffer whose access
161
168
/// is synchronized via a mutex. If you need more explicit control over
162
- /// locking, see the [lock() method][lock].
169
+ /// locking, see the [` lock() method` ][lock].
163
170
///
164
171
/// [lock]: struct.Stdin.html#method.lock
165
172
///
@@ -221,8 +228,11 @@ impl Stdin {
221
228
/// guard.
222
229
///
223
230
/// The lock is released when the returned lock goes out of scope. The
224
- /// returned guard also implements the `Read` and `BufRead` traits for
231
+ /// returned guard also implements the [ `Read`] and [ `BufRead`] traits for
225
232
/// accessing the underlying data.
233
+ ///
234
+ /// [Read]: trait.Read.html
235
+ /// [BufRead]: trait.BufRead.html
226
236
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
227
237
pub fn lock ( & self ) -> StdinLock {
228
238
StdinLock { inner : self . inner . lock ( ) . unwrap_or_else ( |e| e. into_inner ( ) ) }
@@ -231,7 +241,9 @@ impl Stdin {
231
241
/// Locks this handle and reads a line of input into the specified buffer.
232
242
///
233
243
/// For detailed semantics of this method, see the documentation on
234
- /// `BufRead::read_line`.
244
+ /// [`BufRead::read_line`].
245
+ ///
246
+ /// [`BufRead::read_line`]: trait.BufRead.html#method.read_line
235
247
///
236
248
/// # Examples
237
249
///
@@ -314,7 +326,9 @@ const OUT_MAX: usize = ::usize::MAX;
314
326
/// output stream. Access is also synchronized via a lock and explicit control
315
327
/// over locking is available via the `lock` method.
316
328
///
317
- /// Created by the function `io::stdout()`.
329
+ /// Created by the [`io::stdout`] method.
330
+ ///
331
+ /// [`io::stdout`]: fn.stdout.html
318
332
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
319
333
pub struct Stdout {
320
334
// FIXME: this should be LineWriter or BufWriter depending on the state of
@@ -325,8 +339,11 @@ pub struct Stdout {
325
339
326
340
/// A locked reference to the `Stdout` handle.
327
341
///
328
- /// This handle implements the `Write` trait and is constructed via the `lock`
329
- /// method on `Stdout`.
342
+ /// This handle implements the [`Write`] trait, and is constructed via
343
+ /// the [`Stdout::lock`] method.
344
+ ///
345
+ /// [`Write`]: trait.Write.html
346
+ /// [`Stdout::lock`]: struct.Stdout.html#method.lock
330
347
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
331
348
pub struct StdoutLock < ' a > {
332
349
inner : ReentrantMutexGuard < ' a , RefCell < LineWriter < Maybe < StdoutRaw > > > > ,
@@ -336,9 +353,9 @@ pub struct StdoutLock<'a> {
336
353
///
337
354
/// Each handle returned is a reference to a shared global buffer whose access
338
355
/// is synchronized via a mutex. If you need more explicit control over
339
- /// locking, see the [lock() method][lock] .
356
+ /// locking, see the [Stdout:: lock] method.
340
357
///
341
- /// [lock]: struct.Stdout.html#method.lock
358
+ /// [Stdout:: lock]: struct.Stdout.html#method.lock
342
359
///
343
360
/// # Examples
344
361
///
@@ -424,16 +441,20 @@ impl<'a> Write for StdoutLock<'a> {
424
441
425
442
/// A handle to the standard error stream of a process.
426
443
///
427
- /// For more information, see `stderr`
444
+ /// For more information, see the [`io::stderr`] method.
445
+ ///
446
+ /// [`io::stderr`]: fn.stderr.html
428
447
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
429
448
pub struct Stderr {
430
449
inner : Arc < ReentrantMutex < RefCell < Maybe < StderrRaw > > > > ,
431
450
}
432
451
433
452
/// A locked reference to the `Stderr` handle.
434
453
///
435
- /// This handle implements the `Write` trait and is constructed via the `lock`
436
- /// method on `Stderr`.
454
+ /// This handle implements the `Write` trait and is constructed via
455
+ /// the [`Stderr::lock`] method.
456
+ ///
457
+ /// [`Stderr::lock`]: struct.Stderr.html#method.lock
437
458
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
438
459
pub struct StderrLock < ' a > {
439
460
inner : ReentrantMutexGuard < ' a , RefCell < Maybe < StderrRaw > > > ,
0 commit comments