Skip to main content

wait_until

Function wait_until 

Source
pub async fn wait_until<F, Fut>(
    timeout: Duration,
    interval: Duration,
    check: F,
) -> bool
where F: FnMut() -> Fut, Fut: Future<Output = bool>,
Expand description

Polls check until it returns true or timeout elapses.

Returns whether the condition was observed before the deadline. A final attempt is made after the last sleep when the deadline passes between attempts.