fn link_servers(&mut self, servers: &SrvIndex) {
        let mut remaining_ports = self.ports.by_port.keys().copied().collect::<HashSet<u16>>();

        // Get all servers that match this pod.
        let matching = servers.iter_matching(self.labels.clone());
        for (name, port_match, rx) in matching {
            // Get all pod ports that match this server.
            for p in self.ports.collect_port(&port_match).into_iter().flatten() {
                self.link_server_port(p, name, rx);
                remaining_ports.remove(&p);
            }
        }

        // Iterate through the ports that have not been matched to clear them.
        for p in remaining_ports.into_iter() {
            let port = self.ports.by_port.get_mut(&p).unwrap();
            port.server_name = None;
            port.server_tx
                .send(self.default_allow_rx.clone())
                .expect("pod config receiver must still be held");
        }
    }
/// Links this pods to server (by label selector).
//
// XXX This doesn't properly reset a policy when a server is removed or de-selects a pod.
Links this pods to server (by label selector).
XXX This doesn't properly reset a policy when a server is removed or de-selects a pod.
Links this pods to server ( by label selector ) . XXX This doesn ' t properly reset a policy when a server is removed or de - selects a pod .
fn link_servers(&mut self, servers: &SrvIndex) {
        let mut remaining_ports = self.ports.by_port.keys().copied().collect::<HashSet<u16>>();
        // Get all servers that match this pod.
        let matching = servers.iter_matching(self.labels.clone());
        for (name, port_match, rx) in matching {
            // Get all pod ports that match this server.
            for p in self.ports.collect_port(&port_match).into_iter().flatten() {
                self.link_server_port(p, name, rx);
                remaining_ports.remove(&p);
            }
        }
        // Iterate through the ports that have not been matched to clear them.
        for p in remaining_ports.into_iter() {
            let port = self.ports.by_port.get_mut(&p).unwrap();
            port.server_name = None;
            port.server_tx
                .send(self.default_allow_rx.clone())
                .expect("pod config receiver must still be held");
        }
    }
fn link_servers ( & mut self , servers : & SrvIndex ) { let mut remaining_ports = self . ports . by_port . keys ( ) . copied ( ) . collect :: < HashSet < u16 > > ( ) ; // Get all servers that match this pod. let matching = servers . iter_matching ( self . labels . clone ( ) ) ; for ( name , port_match , rx ) in matching { // Get all pod ports that match this server. for p in self . ports . collect_port ( & port_match ) . into_iter ( ) . flatten ( ) { self . link_server_port ( p , name , rx ) ; remaining_ports . remove ( & p ) ; } } // Iterate through the ports that have not been matched to clear them. for p in remaining_ports . into_iter ( ) { let port = self . ports . by_port . get_mut ( & p ) . unwrap ( ) ; port . server_name = None ; port . server_tx . send ( self . default_allow_rx . clone ( ) ) . expect ( " " ) ; } }
Links this pods to server (by label selector).
Links this pods to server ( by label selector ) .
&mut self
servers
&SrvIndex
&mut self
servers
&SrvIndex