leyline-http 0.1.5

HTTP client that impersonates Chrome, Firefox, and Safari on the wire: TLS (JA3/JA4), HTTP/2, and HTTP/3 fingerprints
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");
}