fn check_expirations(&mut self) {
        let now = self.clock.now();
        while let Some(mut first) = self.waiters.peek_min() {
            // Safety: We ensure that any node in the heap remains alive
            unsafe {
                let entry = first.as_mut();
                let first_expiry = entry.expiry;
                if now >= first_expiry {
                    // The timer is expired.
                    entry.state = PollState::Expired;
                    if let Some(task) = entry.task.take() {
                        task.wake();
                    }
                } else {
                    // Remaining timers are not expired
                    break;
                }

                // Remove the expired timer
                self.waiters.remove(entry);
            }
        }
    }
/// Checks whether any of the attached Futures is expired
Checks whether any of the attached Futures is expired
Checks whether any of the attached Futures is expired
fn check_expirations(&mut self) {
        let now = self.clock.now();
        while let Some(mut first) = self.waiters.peek_min() {
            // Safety: We ensure that any node in the heap remains alive
            unsafe {
                let entry = first.as_mut();
                let first_expiry = entry.expiry;
                if now >= first_expiry {
                    // The timer is expired.
                    entry.state = PollState::Expired;
                    if let Some(task) = entry.task.take() {
                        task.wake();
                    }
                } else {
                    // Remaining timers are not expired
                    break;
                }
                // Remove the expired timer
                self.waiters.remove(entry);
            }
        }
    }
fn check_expirations ( & mut self ) { let now = self . clock . now ( ) ; while let Some ( mut first ) = self . waiters . peek_min ( ) { // Safety: We ensure that any node in the heap remains alive unsafe { let entry = first . as_mut ( ) ; let first_expiry = entry . expiry ; if now >= first_expiry { // The timer is expired. entry . state = PollState :: Expired ; if let Some ( task ) = entry . task . take ( ) { task . wake ( ) ; } } else { // Remaining timers are not expired break ; } // Remove the expired timer self . waiters . remove ( entry ) ; } } }
Checks whether any of the attached Futures is expired
Checks whether any of the attached Futures is expired
&mut self
&mut self