pub async fn populate_state(&mut self) -> error::Result<fnet_interfaces::WatcherProxy> {
        for p in self.hal.ports().await?.iter() {
            self.add_port(p.id, &p.path, self.version());
        }
        let watcher = self.hal.create_interface_watcher()?;
        let () = fnet_interfaces_ext::existing(
            fnet_interfaces_ext::event_stream(watcher.clone()),
            HashMap::new(),
        )
        .await
        .map_err(error::Hal::GetExistingInterfacesFailed)?
        // TODO(https://github.com/rust-lang/rust/issues/75294) Use into_values() when stabilized.
        .into_iter()
        .map(|(_, p): (u64, _)| self.notify_lif_added(p))
        .collect::<error::Result<()>>()?;
        self.version += 1;
        Ok(watcher)
    }
/// Populate state based on lower layers.
Populate state based on lower layers.
Populate state based on lower layers .
pub async fn populate_state(&mut self) -> error::Result<fnet_interfaces::WatcherProxy> {
        for p in self.hal.ports().await?.iter() {
            self.add_port(p.id, &p.path, self.version());
        }
        let watcher = self.hal.create_interface_watcher()?;
        let () = fnet_interfaces_ext::existing(
            fnet_interfaces_ext::event_stream(watcher.clone()),
            HashMap::new(),
        )
        .await
        .map_err(error::Hal::GetExistingInterfacesFailed)?
        // TODO(https://github.com/rust-lang/rust/issues/75294) Use into_values() when stabilized.
        .into_iter()
        .map(|(_, p): (u64, _)| self.notify_lif_added(p))
        .collect::<error::Result<()>>()?;
        self.version += 1;
        Ok(watcher)
    }
pub async fn populate_state ( & mut self ) -> error :: Result < fnet_interfaces :: WatcherProxy > { for p in self . hal . ports ( ) . await ? . iter ( ) { self . add_port ( p . id , & p . path , self . version ( ) ) ; } let watcher = self . hal . create_interface_watcher ( ) ? ; let ( ) = fnet_interfaces_ext :: existing ( fnet_interfaces_ext :: event_stream ( watcher . clone ( ) ) , HashMap :: new ( ) , ) . await . map_err ( error :: Hal :: GetExistingInterfacesFailed ) ? // TODO(https://github.com/rust-lang/rust/issues/75294) Use into_values() when stabilized. . into_iter ( ) . map ( | ( _ , p ) : ( u64 , _ ) | self . notify_lif_added ( p ) ) . collect :: < error :: Result < ( ) > > ( ) ? ; self . version += 1 ; Ok ( watcher ) }
Populate state based on lower layers.
Populate state based on lower layers .
&mut self
&mut self