|
| 1 | +// TODO: note that paths like futures_core::task::Context actually get redirected to core::task::Context |
| 2 | +// in the redered docs. Is this desirable? If so, should we change the paths here? |
| 3 | +// |
| 4 | +// Also, there is cross crate links in here. They are not going to work anytime soon. Do we put https links |
| 5 | +// in here? to here: https://rust-lang-nursery.github.io/futures-api-docs? The problem is these have a |
| 6 | +// version hardcoded in the url: 0.3.0-alpha.15 We could link to docs.rs, but currently that says: |
| 7 | +// docs.rs failed to build futures-preview-0.3.0-alpha.15 -> ok the reason seems to be that they are on |
| 8 | +// 2019-04-17 which does still have futures-api unstable feature, so that should get solved. |
| 9 | +// |
1 | 10 | //! Task related testing utilities.
|
2 | 11 | //!
|
3 | 12 | //! This module provides utilities for creating test
|
|
6 | 15 | //! [`Spawn`](futures_core::task::Spawn) implementations.
|
7 | 16 | //!
|
8 | 17 | //! Test contexts:
|
9 |
| -//! - [`noop_context`] creates a context that ignores calls to |
| 18 | +//! - [`noop_context`](crate::task::noop_context) creates a context that ignores calls to |
10 | 19 | //! [`cx.waker().wake_by_ref()`](futures_core::task::Waker).
|
11 |
| -//! - [`panic_context`] creates a context that panics when |
| 20 | +//! - [`panic_context`](crate::task::panic_context) creates a context that panics when |
12 | 21 | //! [`cx.waker().wake_by_ref()`](futures_core::task::Waker) is called.
|
13 | 22 | //!
|
14 | 23 | //! Test wakers:
|
15 |
| -//! - [`noop_waker`] creates a waker that ignores calls to |
| 24 | +//! - [`noop_waker`](crate::task::noop_waker) creates a waker that ignores calls to |
16 | 25 | //! [`wake`](futures_core::task::Waker).
|
17 |
| -//! - [`panic_waker`] creates a waker that panics when |
| 26 | +//! - [`panic_waker`](crate::task::panic_waker::panic_waker) creates a waker that panics when |
18 | 27 | //! [`wake`](futures_core::task::Waker) is called.
|
19 |
| -//! - [`new_count_waker`] creates a waker that increments a counter whenever |
| 28 | +//! - [`new_count_waker`](crate::task::new_count_waker) creates a waker that increments a counter whenever |
20 | 29 | //! [`wake`](futures_core::task::Waker) is called.
|
21 | 30 | //!
|
22 | 31 | //! Test spawners:
|
23 |
| -//! - [`NoopSpawner`] ignores calls to |
24 |
| -//! [`spawn`](futures_core::task::Spawn::spawn) |
25 |
| -//! - [`PanicSpawner`] panics if [`spawn`](futures_core::task::Spawn::spawn) is |
| 32 | +//! - [`NoopSpawner`](crate::task::NoopSpawner) ignores calls to |
| 33 | +//! [`spawn`](::futures_core::task::Spawn::spawn) |
| 34 | +//! - [`PanicSpawner`](crate::task::PanicSpawner) panics if [`spawn`](futures_core::task::Spawn::spawn) is |
26 | 35 | //! called.
|
27 |
| -//! - [`RecordSpawner`] records the spawned futures. |
| 36 | +//! - [`RecordSpawner`](crate::task::RecordSpawner) records the spawned futures. |
28 | 37 | //!
|
29 | 38 | //! For convenience there additionally exist various functions that directly
|
30 |
| -//! return waker/spawner references: [`noop_waker_ref`], |
31 |
| -//! [`panic_waker_ref`], [`noop_spawner_mut`] and [`panic_spawner_mut`]. |
| 39 | +//! return waker/spawner references: [`noop_waker_ref`](crate::task::noop_waker_ref), |
| 40 | +//! [`panic_waker_ref`](crate::task::panic_waker_ref), [`noop_spawner_mut`](crate::task::noop_spawner_mut) and [`panic_spawner_mut`](crate::task::panic_spawner_mut). |
32 | 41 |
|
33 | 42 | mod context;
|
34 | 43 | pub use self::context::{noop_context, panic_context};
|
|
0 commit comments