@@ -147,7 +147,7 @@ impl Timer {
147
147
/// See also:
148
148
/// * [`Self::set_repeating`]
149
149
/// * [`Self::set_oneshot`]
150
- /// * [`Self::remove_callback `].
150
+ /// * [`Self::set_inert `].
151
151
pub fn set_callback ( & self , callback : AnyTimerCallback ) -> Option < AnyTimerCallback > {
152
152
self . callback . lock ( ) . unwrap ( ) . replace ( callback)
153
153
}
@@ -156,7 +156,7 @@ impl Timer {
156
156
///
157
157
/// See also:
158
158
/// * [`Self::set_oneshot`]
159
- /// * [`Self::remove_callback `]
159
+ /// * [`Self::set_inert `]
160
160
pub fn set_repeating < Args > (
161
161
& self ,
162
162
f : impl TimerCallRepeating < Args > ,
@@ -173,17 +173,21 @@ impl Timer {
173
173
///
174
174
/// See also:
175
175
/// * [`Self::set_repeating`]
176
- /// * [`Self::remove_callback `]
176
+ /// * [`Self::set_inert `]
177
177
pub fn set_oneshot < Args > ( & self , f : impl TimerCallOnce < Args > ) -> Option < AnyTimerCallback > {
178
178
self . set_callback ( f. into_oneshot_timer_callback ( ) )
179
179
}
180
180
181
181
/// Remove the callback from the timer.
182
182
///
183
+ /// This does not cancel the timer; it will continue to wake up and be
184
+ /// triggered at its regular period. However, nothing will happen when the
185
+ /// timer is triggered until you give a new callback to the timer.
186
+ ///
183
187
/// You can give the timer a new callback at any time by calling:
184
188
/// * [`Self::set_repeating`]
185
189
/// * [`Self::set_oneshot`]
186
- pub fn remove_callback ( & self ) -> Option < AnyTimerCallback > {
190
+ pub fn set_inert ( & self ) -> Option < AnyTimerCallback > {
187
191
self . set_callback ( AnyTimerCallback :: None )
188
192
}
189
193
0 commit comments