async fn wait_for_child_state(
    hdl: &mut RpcHandle,
    child: &str,
    state: ChildState,
    timeout: Duration,
) -> bool {
    let time = std::time::Instant::now();
    while time.elapsed().as_millis() < timeout.as_millis() {
        if get_child_state(hdl, child).await == state as i32 {
            return true;
        }
        std::thread::sleep(Duration::from_millis(10));
    }
    false
}
/// Wait on the given child state or times out.
/// Returns false if a timeout occurs.
Wait on the given child state or times out.
Returns false if a timeout occurs.
Wait on the given child state or times out . Returns false if a timeout occurs .
async fn wait_for_child_state(
    hdl: &mut RpcHandle,
    child: &str,
    state: ChildState,
    timeout: Duration,
) -> bool {
    let time = std::time::Instant::now();
    while time.elapsed().as_millis() < timeout.as_millis() {
        if get_child_state(hdl, child).await == state as i32 {
            return true;
        }
        std::thread::sleep(Duration::from_millis(10));
    }
    false
}
async fn wait_for_child_state ( hdl : & mut RpcHandle , child : & str , state : ChildState , timeout : Duration , ) -> bool { let time = std :: time :: Instant :: now ( ) ; while time . elapsed ( ) . as_millis ( ) < timeout . as_millis ( ) { if get_child_state ( hdl , child ) . await == state as i32 { return true ; } std :: thread :: sleep ( Duration :: from_millis ( 10 ) ) ; } false }
Wait on the given child state or times out.
Wait on the given child state or times out .
hdl
&mut RpcHandle
child
&str
state
ChildState
timeout
Duration