leyline-http 0.1.1

HTTP client that mimics browsers on the wire
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::time::Duration;

const WAIT_LIMIT: Duration = Duration::from_secs(5);

pub async fn until(mut done: impl FnMut() -> bool) {
    tokio::time::timeout(WAIT_LIMIT, async {
        while !done() {
            tokio::task::yield_now().await;
        }
    })
    .await
    .expect("the condition did not hold in time");
}