async fn update_state(&mut self, interface_info: &hal::Interface) {
        let port_type = port_type(interface_info);
        if port_type == PortType::Loopback {
            return;
        }

        debug!("update_state ->  interface_info: {:?}", interface_info);
        let routes = self.hal.routes().await;
        if let Some(new_info) = compute_state(interface_info, routes, &*self.pinger).await {
            if let Some(info) = self.state_info.get(&interface_info.id) {
                if info == &new_info {
                    // State has not changed, nothing to do.
                    debug!("update_state ->  no change");
                    return;
                }
            } else {
                debug!("update_state ->  new interface");
                if let Some(timer) = &self.timer {
                    debug!("update_state ->  setting timer");
                    timer.periodic(
                        zx::Duration::from_seconds(PROBE_PERIOD_IN_SEC),
                        interface_info.id.to_u64(),
                    );
                }
            }

            self.report(interface_info.id, &new_info);
            self.stats.state_updates += 1;
            debug!("update_state ->  new state {:?}", new_info);
            self.state_info.insert(interface_info.id, new_info);
        };
    }
/// `update_state` processes an event and updates the reachability state accordingly.
`update_state` processes an event and updates the reachability state accordingly.
` update_state ` processes an event and updates the reachability state accordingly .
async fn update_state(&mut self, interface_info: &hal::Interface) {
        let port_type = port_type(interface_info);
        if port_type == PortType::Loopback {
            return;
        }
        debug!("update_state ->  interface_info: {:?}", interface_info);
        let routes = self.hal.routes().await;
        if let Some(new_info) = compute_state(interface_info, routes, &*self.pinger).await {
            if let Some(info) = self.state_info.get(&interface_info.id) {
                if info == &new_info {
                    // State has not changed, nothing to do.
                    debug!("update_state ->  no change");
                    return;
                }
            } else {
                debug!("update_state ->  new interface");
                if let Some(timer) = &self.timer {
                    debug!("update_state ->  setting timer");
                    timer.periodic(
                        zx::Duration::from_seconds(PROBE_PERIOD_IN_SEC),
                        interface_info.id.to_u64(),
                    );
                }
            }
            self.report(interface_info.id, &new_info);
            self.stats.state_updates += 1;
            debug!("update_state ->  new state {:?}", new_info);
            self.state_info.insert(interface_info.id, new_info);
        };
    }
async fn update_state ( & mut self , interface_info : & hal :: Interface ) { let port_type = port_type ( interface_info ) ; if port_type == PortType :: Loopback { return ; } debug ! ( " " interface_info ) ; let routes = self . hal . routes ( ) . await ; if let Some ( new_info ) = compute_state ( interface_info , routes , & * self . pinger ) . await { if let Some ( info ) = self . state_info . get ( & interface_info . id ) { if info == & new_info { // State has not changed, nothing to do. debug ! ( " " ) ; return ; } } else { debug ! ( " " ) ; if let Some ( timer ) = & self . timer { debug ! ( " " ) ; timer . periodic ( zx :: Duration :: from_seconds ( PROBE_PERIOD_IN_SEC ) , interface_info . id . to_u64 ( ) , ) ; } } self . report ( interface_info . id , & new_info ) ; self . stats . state_updates += 1 ; debug ! ( " " new_info ) ; self . state_info . insert ( interface_info . id , new_info ) ; } ; }
`update_state` processes an event and updates the reachability state accordingly.
` update_state ` processes an event and updates the reachability state accordingly .
&mut self
interface_info
&hal::Interface