+
+ /// Waits until this [`Future`] completes.
+ #[cfg(feature = "std")]
+ pub fn wait(self) {
+ Sleeper::from_single_future(self).wait();
+ }
+
+ /// Waits until this [`Future`] completes or the given amount of time has elapsed.
+ ///
+ /// Returns true if the [`Future`] completed, false if the time elapsed.
+ #[cfg(feature = "std")]
+ pub fn wait_timeout(self, max_wait: Duration) -> bool {
+ Sleeper::from_single_future(self).wait_timeout(max_wait)
+ }
+
+ #[cfg(test)]
+ pub fn poll_is_complete(&self) -> bool {
+ let mut state = self.state.lock().unwrap();
+ if state.complete {
+ state.callbacks_made = true;
+ true
+ } else { false }
+ }