Skip to content

Commit 4cab868

Browse files
authored
Merge pull request #394 from async-rs/link-types
backreference links for structs
2 parents 81e3cab + 4475a22 commit 4cab868

24 files changed

+133
-19
lines changed

src/io/empty.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ pub fn empty() -> Empty {
2828

2929
/// A reader that contains no data.
3030
///
31-
/// This reader is constructed by the [`sink`] function.
31+
/// This reader is created by the [`empty`] function. See its
32+
/// documentation for more.
3233
///
33-
/// [`sink`]: fn.sink.html
34+
/// [`empty`]: fn.empty.html
3435
pub struct Empty {
3536
_private: (),
3637
}

src/io/repeat.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ pub fn repeat(byte: u8) -> Repeat {
2929

3030
/// A reader which yields one byte over and over and over and over and over and...
3131
///
32-
/// This reader is constructed by the [`repeat`] function.
32+
/// This reader is created by the [`repeat`] function. See its
33+
/// documentation for more.
3334
///
3435
/// [`repeat`]: fn.repeat.html
3536
pub struct Repeat {

src/io/sink.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ pub fn sink() -> Sink {
2525

2626
/// A writer that consumes and drops all data.
2727
///
28-
/// This writer is constructed by the [`sink`] function.
28+
/// This writer is constructed by the [`sink`] function. See its documentation
29+
/// for more.
2930
///
3031
/// [`sink`]: fn.sink.html
3132
pub struct Sink {

src/io/stderr.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ use crate::task::{blocking, Context, JoinHandle, Poll};
1111
///
1212
/// [`std::io::stderr`]: https://doc.rust-lang.org/std/io/fn.stderr.html
1313
///
14+
/// ### Note: Windows Portability Consideration
15+
///
16+
/// When operating in a console, the Windows implementation of this stream does not support
17+
/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
18+
/// an error.
19+
///
1420
/// # Examples
1521
///
1622
/// ```no_run
@@ -34,12 +40,16 @@ pub fn stderr() -> Stderr {
3440

3541
/// A handle to the standard error of the current process.
3642
///
37-
/// Created by the [`stderr`] function.
43+
/// This writer is created by the [`stderr`] function. See its documentation for
44+
/// more.
45+
///
46+
/// ### Note: Windows Portability Consideration
3847
///
39-
/// This type is an async version of [`std::io::Stderr`].
48+
/// When operating in a console, the Windows implementation of this stream does not support
49+
/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
50+
/// an error.
4051
///
4152
/// [`stderr`]: fn.stderr.html
42-
/// [`std::io::Stderr`]: https://doc.rust-lang.org/std/io/struct.Stderr.html
4353
#[derive(Debug)]
4454
pub struct Stderr(Mutex<State>);
4555

src/io/stdin.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ use crate::task::{blocking, Context, JoinHandle, Poll};
1111
///
1212
/// [`std::io::stdin`]: https://doc.rust-lang.org/std/io/fn.stdin.html
1313
///
14+
/// ### Note: Windows Portability Consideration
15+
///
16+
/// When operating in a console, the Windows implementation of this stream does not support
17+
/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
18+
/// an error.
19+
///
1420
/// # Examples
1521
///
1622
/// ```no_run
@@ -35,12 +41,16 @@ pub fn stdin() -> Stdin {
3541

3642
/// A handle to the standard input of the current process.
3743
///
38-
/// Created by the [`stdin`] function.
44+
/// This reader is created by the [`stdin`] function. See its documentation for
45+
/// more.
46+
///
47+
/// ### Note: Windows Portability Consideration
3948
///
40-
/// This type is an async version of [`std::io::Stdin`].
49+
/// When operating in a console, the Windows implementation of this stream does not support
50+
/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
51+
/// an error.
4152
///
4253
/// [`stdin`]: fn.stdin.html
43-
/// [`std::io::Stdin`]: https://doc.rust-lang.org/std/io/struct.Stdin.html
4454
#[derive(Debug)]
4555
pub struct Stdin(Mutex<State>);
4656

src/io/stdout.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ use crate::task::{blocking, Context, JoinHandle, Poll};
1111
///
1212
/// [`std::io::stdout`]: https://doc.rust-lang.org/std/io/fn.stdout.html
1313
///
14+
/// ### Note: Windows Portability Consideration
15+
///
16+
/// When operating in a console, the Windows implementation of this stream does not support
17+
/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
18+
/// an error.
19+
///
1420
/// # Examples
1521
///
1622
/// ```no_run
@@ -34,12 +40,16 @@ pub fn stdout() -> Stdout {
3440

3541
/// A handle to the standard output of the current process.
3642
///
37-
/// Created by the [`stdout`] function.
43+
/// This writer is created by the [`stdout`] function. See its documentation
44+
/// for more.
45+
///
46+
/// ### Note: Windows Portability Consideration
3847
///
39-
/// This type is an async version of [`std::io::Stdout`].
48+
/// When operating in a console, the Windows implementation of this stream does not support
49+
/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
50+
/// an error.
4051
///
4152
/// [`stdout`]: fn.stdout.html
42-
/// [`std::io::Stdout`]: https://doc.rust-lang.org/std/io/struct.Stdout.html
4353
#[derive(Debug)]
4454
pub struct Stdout(Mutex<State>);
4555

src/stream/empty.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ use crate::task::{Context, Poll};
66

77
/// Creates a stream that doesn't yield any items.
88
///
9+
/// This `struct` is created by the [`empty`] function. See its
10+
/// documentation for more.
11+
///
12+
/// [`empty`]: fn.empty.html
13+
///
914
/// # Examples
1015
///
1116
/// ```

src/stream/from_fn.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ use crate::task::{Context, Poll};
1010
pin_project! {
1111
/// A stream that yields elements by calling a closure.
1212
///
13-
/// This stream is constructed by [`from_fn`] function.
13+
/// This stream is created by the [`from_fn`] function. See its
14+
/// documentation for more.
1415
///
1516
/// [`from_fn`]: fn.from_fn.html
1617
#[derive(Debug)]

src/stream/interval.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ pub fn interval(dur: Duration) -> Interval {
5252

5353
/// A stream representing notifications at fixed interval
5454
///
55+
/// This stream is created by the [`interval`] function. See its
56+
/// documentation for more.
57+
///
58+
/// [`interval`]: fn.interval.html
5559
#[cfg(feature = "unstable")]
5660
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
5761
#[derive(Debug)]

src/stream/once.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ pub fn once<T>(t: T) -> Once<T> {
2929
pin_project! {
3030
/// A stream that yields a single item.
3131
///
32-
/// This stream is constructed by the [`once`] function.
32+
/// This stream is created by the [`once`] function. See its
33+
/// documentation for more.
3334
///
3435
/// [`once`]: fn.once.html
3536
#[derive(Debug)]

0 commit comments

Comments
 (0)