async fn wait_for_num_rebuilds(
    hdl: &mut RpcHandle,
    num_rebuilds: u32,
    timeout: Duration,
) -> bool {
    let time = std::time::Instant::now();
    while time.elapsed().as_millis() < timeout.as_millis() {
        if get_num_rebuilds(hdl).await == num_rebuilds {
            return true;
        }
        std::thread::sleep(Duration::from_millis(10));
    }
    false
}
/// Wait for the number of rebuilds to reach the desired number.
/// Returns false if a timeout occurs.
Wait for the number of rebuilds to reach the desired number.
Returns false if a timeout occurs.
Wait for the number of rebuilds to reach the desired number . Returns false if a timeout occurs .
async fn wait_for_num_rebuilds(
    hdl: &mut RpcHandle,
    num_rebuilds: u32,
    timeout: Duration,
) -> bool {
    let time = std::time::Instant::now();
    while time.elapsed().as_millis() < timeout.as_millis() {
        if get_num_rebuilds(hdl).await == num_rebuilds {
            return true;
        }
        std::thread::sleep(Duration::from_millis(10));
    }
    false
}
async fn wait_for_num_rebuilds ( hdl : & mut RpcHandle , num_rebuilds : u32 , timeout : Duration , ) -> bool { let time = std :: time :: Instant :: now ( ) ; while time . elapsed ( ) . as_millis ( ) < timeout . as_millis ( ) { if get_num_rebuilds ( hdl ) . await == num_rebuilds { return true ; } std :: thread :: sleep ( Duration :: from_millis ( 10 ) ) ; } false }
Wait for the number of rebuilds to reach the desired number.
Wait for the number of rebuilds to reach the desired number .
hdl
&mut RpcHandle
num_rebuilds
u32
timeout
Duration