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)]

src/stream/repeat.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ where
2929

3030
/// A stream that yields the same item repeatedly.
3131
///
32-
/// This stream is constructed by the [`repeat`] function.
32+
/// This stream is created by the [`repeat`] function. See its
33+
/// documentation for more.
3334
///
3435
/// [`repeat`]: fn.repeat.html
3536
#[derive(Debug)]

src/stream/repeat_with.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 repeats elements of type `T` endlessly by applying a provided closure.
1212
///
13-
/// This stream is constructed by the [`repeat_with`] function.
13+
/// This stream is created by the [`repeat_with`] function. See its
14+
/// documentation for more.
1415
///
1516
/// [`repeat_with`]: fn.repeat_with.html
1617
#[derive(Debug)]

src/stream/stream/chain.rs

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

99
pin_project! {
1010
/// Chains two streams one after another.
11+
///
12+
/// This `struct` is created by the [`chain`] method on [`Stream`]. See its
13+
/// documentation for more.
14+
///
15+
/// [`chain`]: trait.Stream.html#method.chain
16+
/// [`Stream`]: trait.Stream.html
1117
#[derive(Debug)]
1218
pub struct Chain<S, U> {
1319
#[pin]

src/stream/stream/filter.rs

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

99
pin_project! {
1010
/// A stream to filter elements of another stream with a predicate.
11+
///
12+
/// This `struct` is created by the [`filter`] method on [`Stream`]. See its
13+
/// documentation for more.
14+
///
15+
/// [`filter`]: trait.Stream.html#method.filter
16+
/// [`Stream`]: trait.Stream.html
1117
#[derive(Debug)]
1218
pub struct Filter<S, P, T> {
1319
#[pin]

src/stream/stream/fuse.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ use crate::task::{Context, Poll};
88
pin_project! {
99
/// A `Stream` that is permanently closed once a single call to `poll` results in
1010
/// `Poll::Ready(None)`, returning `Poll::Ready(None)` for all future calls to `poll`.
11+
///
12+
/// This `struct` is created by the [`fuse`] method on [`Stream`]. See its
13+
/// documentation for more.
14+
///
15+
/// [`fuse`]: trait.Stream.html#method.fuse
16+
/// [`Stream`]: trait.Stream.html
1117
#[derive(Clone, Debug)]
1218
pub struct Fuse<S> {
1319
#[pin]

src/stream/stream/inspect.rs

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

99
pin_project! {
1010
/// A stream that does something with each element of another stream.
11+
///
12+
/// This `struct` is created by the [`inspect`] method on [`Stream`]. See its
13+
/// documentation for more.
14+
///
15+
/// [`inspect`]: trait.Stream.html#method.inspect
16+
/// [`Stream`]: trait.Stream.html
1117
#[derive(Debug)]
1218
pub struct Inspect<S, F, T> {
1319
#[pin]

src/stream/stream/merge.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ use pin_project_lite::pin_project;
77
pin_project! {
88
/// A stream that merges two other streams into a single stream.
99
///
10-
/// This stream is returned by [`Stream::merge`].
10+
/// This `struct` is created by the [`merge`] method on [`Stream`]. See its
11+
/// documentation for more.
1112
///
12-
/// [`Stream::merge`]: trait.Stream.html#method.merge
13+
/// [`merge`]: trait.Stream.html#method.merge
14+
/// [`Stream`]: trait.Stream.html
1315
#[cfg(feature = "unstable")]
1416
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
1517
#[derive(Debug)]

src/stream/stream/scan.rs

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

88
pin_project! {
99
/// A stream to maintain state while polling another stream.
10+
///
11+
/// This `struct` is created by the [`scan`] method on [`Stream`]. See its
12+
/// documentation for more.
13+
///
14+
/// [`scan`]: trait.Stream.html#method.scan
15+
/// [`Stream`]: trait.Stream.html
1016
#[derive(Debug)]
1117
pub struct Scan<S, St, F> {
1218
#[pin]

src/stream/stream/skip.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ use crate::stream::Stream;
77

88
pin_project! {
99
/// A stream to skip first n elements of another stream.
10+
///
11+
/// This `struct` is created by the [`skip`] method on [`Stream`]. See its
12+
/// documentation for more.
13+
///
14+
/// [`skip`]: trait.Stream.html#method.skip
15+
/// [`Stream`]: trait.Stream.html
1016
#[derive(Debug)]
1117
pub struct Skip<S> {
1218
#[pin]

src/stream/stream/skip_while.rs

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

99
pin_project! {
1010
/// A stream to skip elements of another stream based on a predicate.
11+
///
12+
/// This `struct` is created by the [`skip_while`] method on [`Stream`]. See its
13+
/// documentation for more.
14+
///
15+
/// [`skip_while`]: trait.Stream.html#method.skip_while
16+
/// [`Stream`]: trait.Stream.html
1117
#[derive(Debug)]
1218
pub struct SkipWhile<S, P, T> {
1319
#[pin]

src/stream/stream/step_by.rs

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

88
pin_project! {
99
/// A stream that steps a given amount of elements of another stream.
10+
///
11+
/// This `struct` is created by the [`step_by`] method on [`Stream`]. See its
12+
/// documentation for more.
13+
///
14+
/// [`step_by`]: trait.Stream.html#method.step_by
15+
/// [`Stream`]: trait.Stream.html
1016
#[derive(Debug)]
1117
pub struct StepBy<S> {
1218
#[pin]

src/stream/stream/take.rs

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

88
pin_project! {
99
/// A stream that yields the first `n` items of another stream.
10+
///
11+
/// This `struct` is created by the [`take`] method on [`Stream`]. See its
12+
/// documentation for more.
13+
///
14+
/// [`take`]: trait.Stream.html#method.take
15+
/// [`Stream`]: trait.Stream.html
1016
#[derive(Clone, Debug)]
1117
pub struct Take<S> {
1218
#[pin]

src/stream/stream/take_while.rs

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

99
pin_project! {
1010
/// A stream that yields elements based on a predicate.
11+
///
12+
/// This `struct` is created by the [`take_while`] method on [`Stream`]. See its
13+
/// documentation for more.
14+
///
15+
/// [`take_while`]: trait.Stream.html#method.take_while
16+
/// [`Stream`]: trait.Stream.html
1117
#[derive(Debug)]
1218
pub struct TakeWhile<S, P, T> {
1319
#[pin]

src/stream/stream/zip.rs

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

99
pin_project! {
1010
/// An iterator that iterates two other iterators simultaneously.
11+
///
12+
/// This `struct` is created by the [`zip`] method on [`Stream`]. See its
13+
/// documentation for more.
14+
///
15+
/// [`zip`]: trait.Stream.html#method.zip
16+
/// [`Stream`]: trait.Stream.html
1117
pub struct Zip<A: Stream, B> {
1218
item_slot: Option<A::Item>,
1319
#[pin]

0 commit comments

Comments
 (0)