@@ -10,6 +10,8 @@ use crate::marker::{PhantomData, Unpin};
10
10
///
11
11
/// It consists of a data pointer and a [virtual function pointer table (vtable)][vtable] that
12
12
/// customizes the behavior of the `RawWaker`.
13
+ ///
14
+ /// [`Waker`]: struct.Waker.html
13
15
#[ derive( PartialEq , Debug ) ]
14
16
#[ stable( feature = "futures_api" , since = "1.36.0" ) ]
15
17
pub struct RawWaker {
@@ -55,6 +57,8 @@ impl RawWaker {
55
57
/// pointer of a properly constructed [`RawWaker`] object from inside the
56
58
/// [`RawWaker`] implementation. Calling one of the contained functions using
57
59
/// any other `data` pointer will cause undefined behavior.
60
+ ///
61
+ /// [`RawWaker`]: struct.RawWaker.html
58
62
#[ stable( feature = "futures_api" , since = "1.36.0" ) ]
59
63
#[ derive( PartialEq , Copy , Clone , Debug ) ]
60
64
pub struct RawWakerVTable {
@@ -65,6 +69,9 @@ pub struct RawWakerVTable {
65
69
/// required for this additional instance of a [`RawWaker`] and associated
66
70
/// task. Calling `wake` on the resulting [`RawWaker`] should result in a wakeup
67
71
/// of the same task that would have been awoken by the original [`RawWaker`].
72
+ ///
73
+ /// [`Waker`]: struct.Waker.html
74
+ /// [`RawWaker`]: struct.RawWaker.html
68
75
clone : unsafe fn ( * const ( ) ) -> RawWaker ,
69
76
70
77
/// This function will be called when `wake` is called on the [`Waker`].
@@ -73,20 +80,28 @@ pub struct RawWakerVTable {
73
80
/// The implementation of this function must make sure to release any
74
81
/// resources that are associated with this instance of a [`RawWaker`] and
75
82
/// associated task.
83
+ ///
84
+ /// [`Waker`]: struct.Waker.html
85
+ /// [`RawWaker`]: struct.RawWaker.html
76
86
wake : unsafe fn ( * const ( ) ) ,
77
87
78
88
/// This function will be called when `wake_by_ref` is called on the [`Waker`].
79
89
/// It must wake up the task associated with this [`RawWaker`].
80
90
///
81
91
/// This function is similar to `wake`, but must not consume the provided data
82
92
/// pointer.
93
+ ///
94
+ /// [`Waker`]: struct.Waker.html
95
+ /// [`RawWaker`]: struct.RawWaker.html
83
96
wake_by_ref : unsafe fn ( * const ( ) ) ,
84
97
85
98
/// This function gets called when a [`RawWaker`] gets dropped.
86
99
///
87
100
/// The implementation of this function must make sure to release any
88
101
/// resources that are associated with this instance of a [`RawWaker`] and
89
102
/// associated task.
103
+ ///
104
+ /// [`RawWaker`]: struct.RawWaker.html
90
105
drop : unsafe fn ( * const ( ) ) ,
91
106
}
92
107
@@ -128,6 +143,9 @@ impl RawWakerVTable {
128
143
/// The implementation of this function must make sure to release any
129
144
/// resources that are associated with this instance of a [`RawWaker`] and
130
145
/// associated task.
146
+ ///
147
+ /// [`Waker`]: struct.Waker.html
148
+ /// [`RawWaker`]: struct.RawWaker.html
131
149
#[ rustc_promotable]
132
150
#[ cfg_attr( stage0, unstable( feature = "futures_api_const_fn_ptr" , issue = "50547" ) ) ]
133
151
#[ cfg_attr( not( stage0) , stable( feature = "futures_api" , since = "1.36.0" ) ) ]
@@ -201,6 +219,8 @@ impl fmt::Debug for Context<'_> {
201
219
/// executor-specific wakeup behavior.
202
220
///
203
221
/// Implements [`Clone`], [`Send`], and [`Sync`].
222
+ ///
223
+ /// [`RawWaker`]: struct.RawWaker.html
204
224
#[ repr( transparent) ]
205
225
#[ stable( feature = "futures_api" , since = "1.36.0" ) ]
206
226
pub struct Waker {
@@ -266,6 +286,9 @@ impl Waker {
266
286
/// The behavior of the returned `Waker` is undefined if the contract defined
267
287
/// in [`RawWaker`]'s and [`RawWakerVTable`]'s documentation is not upheld.
268
288
/// Therefore this method is unsafe.
289
+ ///
290
+ /// [`RawWaker`]: struct.RawWaker.html
291
+ /// [`RawWakerVTable`]: struct.RawWakerVTable.html
269
292
#[ inline]
270
293
#[ stable( feature = "futures_api" , since = "1.36.0" ) ]
271
294
pub unsafe fn from_raw ( waker : RawWaker ) -> Waker {
0 commit comments