/// Method waits for client state changes.
/// It differ from [wait_auth_state_change](crate::client::worker::Worker::wait_auth_state_change) by error type: you won't receive (AuthorizationState)[crate::types::authorization_state::AuthorizationState] when error occured.
/// Method may be useful if client already authorized on, for example, previous application startup.
Method waits for client state changes.
Method waits for client state changes .
pub async fn wait_client_state(&self, client: &Client<T>) -> RTDResult<ClientState> {
        let guard = self.clients.read().await;
        match guard.get(&client.get_client_id()?) {
            None => Err(RTDError::BadRequest("client not bound yet")),
            Some(ctx) => {
                let mut rec = ctx.private_state_message_receiver().lock().await;
                Ok(rec.recv().await.unwrap())
            }
        }
    }
pub async fn wait_client_state ( & self , client : & Client < T > ) -> RTDResult < ClientState > { let guard = self . clients . read ( ) . await ; match guard . get ( & client . get_client_id ( ) ? ) { None => Err ( RTDError :: BadRequest ( " " ) ) , Some ( ctx ) => { let mut rec = ctx . private_state_message_receiver ( ) . lock ( ) . await ; Ok ( rec . recv ( ) . await . unwrap ( ) ) } } }
Method waits for client state changes.
Method waits for client state changes .
&self
client
&Client<T>