async fn check_server(&mut self, topology: &Topology, server: &Server) -> bool {
        let mut retried = false;
        let check_result = match self.perform_is_master(topology).await {
            Ok(reply) => Ok(reply),
            Err(e) => {
                let previous_description = topology.get_server_description(&server.address).await;
                if e.is_network_error()
                    && previous_description
                        .map(|sd| sd.is_available())
                        .unwrap_or(false)
                {
                    self.handle_error(e, topology, server).await;
                    retried = true;
                    self.perform_is_master(topology).await
                } else {
                    Err(e)
                }
            }
        };

        match check_result {
            Ok(reply) => {
                let server_description =
                    ServerDescription::new(server.address.clone(), Some(Ok(reply)));
                topology.update(server, server_description).await
            }
            Err(e) => self.handle_error(e, topology, server).await || retried,
        }
    }
/// Checks the the server by running an `isMaster` command. If an I/O error occurs, the
/// connection will replaced with a new one.
///
/// Returns true if the topology has changed and false otherwise.
Checks the the server by running an `isMaster` command. If an I/O error occurs, the
connection will replaced with a new one.

Returns true if the topology has changed and false otherwise.
Checks the the server by running an ` isMaster ` command . If an I / O error occurs the connection will replaced with a new one . Returns true if the topology has changed and false otherwise .
async fn check_server(&mut self, topology: &Topology, server: &Server) -> bool {
        let mut retried = false;
        let check_result = match self.perform_is_master(topology).await {
            Ok(reply) => Ok(reply),
            Err(e) => {
                let previous_description = topology.get_server_description(&server.address).await;
                if e.is_network_error()
                    && previous_description
                        .map(|sd| sd.is_available())
                        .unwrap_or(false)
                {
                    self.handle_error(e, topology, server).await;
                    retried = true;
                    self.perform_is_master(topology).await
                } else {
                    Err(e)
                }
            }
        };
        match check_result {
            Ok(reply) => {
                let server_description =
                    ServerDescription::new(server.address.clone(), Some(Ok(reply)));
                topology.update(server, server_description).await
            }
            Err(e) => self.handle_error(e, topology, server).await || retried,
        }
    }
async fn check_server ( & mut self , topology : & Topology , server : & Server ) -> bool { let mut retried = false ; let check_result = match self . perform_is_master ( topology ) . await { Ok ( reply ) => Ok ( reply ) , Err ( e ) => { let previous_description = topology . get_server_description ( & server . address ) . await ; if e . is_network_error ( ) && previous_description . map ( | sd | sd . is_available ( ) ) . unwrap_or ( false ) { self . handle_error ( e , topology , server ) . await ; retried = true ; self . perform_is_master ( topology ) . await } else { Err ( e ) } } } ; match check_result { Ok ( reply ) => { let server_description = ServerDescription :: new ( server . address . clone ( ) , Some ( Ok ( reply ) ) ) ; topology . update ( server , server_description ) . await } Err ( e ) => self . handle_error ( e , topology , server ) . await || retried , } }
Checks the the server by running an `isMaster` command.
Checks the the server by running an ` isMaster ` command .
&mut self
topology
&Topology
server
&Server
&mut self
topology
&Topology
server
&Server