fn poll_idx(&mut self, cx: &mut task::Context<'_>) -> Poll<Option<Result<usize, Error>>> {
        use self::wheel::Stack;

        let expired = self.expired.pop(&mut self.slab);

        if expired.is_some() {
            return Poll::Ready(expired.map(Ok));
        }

        loop {
            if let Some(ref mut delay) = self.delay {
                if !delay.is_elapsed() {
                    ready!(Pin::new(&mut *delay).poll(cx));
                }

                let now = crate::time::ms(delay.deadline() - self.start, crate::time::Round::Down);

                self.wheel_now = now;
            }

            // We poll the wheel to get the next value out before finding the next deadline.
            let wheel_idx = self.wheel.poll(self.wheel_now, &mut self.slab);

            self.delay = self.next_deadline().map(|when| Box::pin(sleep_until(when)));

            if let Some(idx) = wheel_idx {
                return Poll::Ready(Some(Ok(idx)));
            }

            if self.delay.is_none() {
                return Poll::Ready(None);
            }
        }
    }
/// Polls the queue, returning the index of the next slot in the slab that
/// should be returned.
///
/// A slot should be returned when the associated deadline has been reached.
Polls the queue, returning the index of the next slot in the slab that
should be returned.

A slot should be returned when the associated deadline has been reached.
Polls the queue returning the index of the next slot in the slab that should be returned . A slot should be returned when the associated deadline has been reached .
fn poll_idx(&mut self, cx: &mut task::Context<'_>) -> Poll<Option<Result<usize, Error>>> {
        use self::wheel::Stack;
        let expired = self.expired.pop(&mut self.slab);
        if expired.is_some() {
            return Poll::Ready(expired.map(Ok));
        }
        loop {
            if let Some(ref mut delay) = self.delay {
                if !delay.is_elapsed() {
                    ready!(Pin::new(&mut *delay).poll(cx));
                }
                let now = crate::time::ms(delay.deadline() - self.start, crate::time::Round::Down);
                self.wheel_now = now;
            }
            // We poll the wheel to get the next value out before finding the next deadline.
            let wheel_idx = self.wheel.poll(self.wheel_now, &mut self.slab);
            self.delay = self.next_deadline().map(|when| Box::pin(sleep_until(when)));
            if let Some(idx) = wheel_idx {
                return Poll::Ready(Some(Ok(idx)));
            }
            if self.delay.is_none() {
                return Poll::Ready(None);
            }
        }
    }
fn poll_idx ( & mut self , cx : & mut task :: Context < ' _ > ) -> Poll < Option < Result < usize , Error > > > { use self :: wheel :: Stack ; let expired = self . expired . pop ( & mut self . slab ) ; if expired . is_some ( ) { return Poll :: Ready ( expired . map ( Ok ) ) ; } loop { if let Some ( ref mut delay ) = self . delay { if ! delay . is_elapsed ( ) { ready ! ( Pin new ( mut delay ) poll ( cx ) ) ; } let now = crate :: time :: ms ( delay . deadline ( ) - self . start , crate :: time :: Round :: Down ) ; self . wheel_now = now ; } // We poll the wheel to get the next value out before finding the next deadline. let wheel_idx = self . wheel . poll ( self . wheel_now , & mut self . slab ) ; self . delay = self . next_deadline ( ) . map ( | when | Box :: pin ( sleep_until ( when ) ) ) ; if let Some ( idx ) = wheel_idx { return Poll :: Ready ( Some ( Ok ( idx ) ) ) ; } if self . delay . is_none ( ) { return Poll :: Ready ( None ) ; } } }
Polls the queue, returning the index of the next slot in the slab that
should be returned.
Polls the queue returning the index of the next slot in the slab that should be returned .
&mut self
cx
&mut task::Context<'_>