Sleeps for one polling interval, returning false at the deadline.
(&self, deadline: Instant)
| 764 | |
| 765 | /// Sleeps for one polling interval, returning false at the deadline. |
| 766 | pub async fn wait(&self, deadline: Instant) -> bool { |
| 767 | let Some(remaining) = deadline.checked_duration_since(Instant::now()) else { return false }; |
| 768 | tokio::time::sleep(self.poll.min(remaining)).await; |
| 769 | Instant::now() < deadline |
| 770 | } |
| 771 | |
| 772 | /// Resolves a logical role without exposing its URL in errors. |
| 773 | pub fn endpoint<'a>(map: &'a BTreeMap<String, String>, role: &str) -> Result<&'a str> { |