fn record_primary_state(&mut self) {
        self.topology_type = if self
            .servers
            .values()
            .any(|server| server.server_type == ServerType::RsPrimary)
        {
            TopologyType::ReplicaSetWithPrimary
        } else {
            TopologyType::ReplicaSetNoPrimary
        };
    }
/// Inspect the topology for a primary server, and update the topology type to
/// ReplicaSetNoPrimary if none is found.
///
/// This should only be called on a replica set topology.
Inspect the topology for a primary server, and update the topology type to
ReplicaSetNoPrimary if none is found.

This should only be called on a replica set topology.
Inspect the topology for a primary server and update the topology type to ReplicaSetNoPrimary if none is found . This should only be called on a replica set topology .
fn record_primary_state(&mut self) {
        self.topology_type = if self
            .servers
            .values()
            .any(|server| server.server_type == ServerType::RsPrimary)
        {
            TopologyType::ReplicaSetWithPrimary
        } else {
            TopologyType::ReplicaSetNoPrimary
        };
    }
fn record_primary_state ( & mut self ) { self . topology_type = if self . servers . values ( ) . any ( | server | server . server_type == ServerType :: RsPrimary ) { TopologyType :: ReplicaSetWithPrimary } else { TopologyType :: ReplicaSetNoPrimary } ; }
Inspect the topology for a primary server, and update the topology type to
ReplicaSetNoPrimary if none is found.
Inspect the topology for a primary server and update the topology type to ReplicaSetNoPrimary if none is found .
&mut self
&mut self