/// Returns the diff between this topology description and the provided one, or `None` if
/// they are equal.
///
/// The returned `TopologyDescriptionDiff` refers to the changes reflected in the provided
/// description. For example, if the provided description has a server in it that this
/// description does not, it will be returned in the `added_addresses` field.
Returns the diff between this topology description and the provided one, or `None` if
they are equal.

The returned `TopologyDescriptionDiff` refers to the changes reflected in the provided
description. For example, if the provided description has a server in it that this
description does not, it will be returned in the `added_addresses` field.
Returns the diff between this topology description and the provided one or ` None ` if they are equal . The returned ` TopologyDescriptionDiff ` refers to the changes reflected in the provided description . For example if the provided description has a server in it that this description does not it will be returned in the ` added_addresses ` field .
pub(crate) fn diff<'a>(
        &'a self,
        other: &'a TopologyDescription,
    ) -> Option<TopologyDescriptionDiff> {
        if self == other {
            return None;
        }
        let addresses: HashSet<&ServerAddress> = self.server_addresses().collect();
        let other_addresses: HashSet<&ServerAddress> = other.server_addresses().collect();
        let changed_servers = self
            .servers
            .iter()
            .filter_map(|(address, description)| match other.servers.get(address) {
                Some(other_description) if description != other_description => {
                    Some((address, (description, other_description)))
                }
                _ => None,
            });
        Some(TopologyDescriptionDiff {
            removed_addresses: addresses.difference(&other_addresses).cloned().collect(),
            added_addresses: other_addresses.difference(&addresses).cloned().collect(),
            changed_servers: changed_servers.collect(),
        })
    }
pub ( crate ) fn diff < ' a > ( & ' a self , other : & ' a TopologyDescription , ) -> Option < TopologyDescriptionDiff > { if self == other { return None ; } let addresses : HashSet < & ServerAddress > = self . server_addresses ( ) . collect ( ) ; let other_addresses : HashSet < & ServerAddress > = other . server_addresses ( ) . collect ( ) ; let changed_servers = self . servers . iter ( ) . filter_map ( | ( address , description ) | match other . servers . get ( address ) { Some ( other_description ) if description != other_description => { Some ( ( address , ( description , other_description ) ) ) } _ => None , } ) ; Some ( TopologyDescriptionDiff { removed_addresses : addresses . difference ( & other_addresses ) . cloned ( ) . collect ( ) , added_addresses : other_addresses . difference ( & addresses ) . cloned ( ) . collect ( ) , changed_servers : changed_servers . collect ( ) , } ) }
Returns the diff between this topology description and the provided one, or `None` if
they are equal.
Returns the diff between this topology description and the provided one or ` None ` if they are equal .
&'a self
other
&'a TopologyDescription