Time until the next retry is due, or None if queue is empty.
(&self)
| 124 | |
| 125 | /// Time until the next retry is due, or None if queue is empty. |
| 126 | pub fn next_retry_delay(&self) -> Option<Duration> { |
| 127 | self.queue.front().map(|e| { |
| 128 | let now = Instant::now(); |
| 129 | if e.next_retry_at > now { |
| 130 | e.next_retry_at - now |
| 131 | } else { |
| 132 | Duration::ZERO |
| 133 | } |
| 134 | }) |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | impl Default for TriggerRetryQueue { |