async fn configure_default_interface(
        &mut self,
        pid: PortId,
        topological_path: &str,
    ) -> error::Result<()> {
        match self.config.default_interface() {
            Some(default_interface) => match default_interface.config.interface_type {
                config::InterfaceType::IfUplink => self.configure_wan(pid, topological_path).await,
                config::InterfaceType::IfEthernet => {
                    self.configure_lan(&[pid], topological_path).await
                }
                InterfaceType::IfAggregate
                | InterfaceType::IfLoopback
                | InterfaceType::IfRoutedVlan
                | InterfaceType::IfSonet
                | InterfaceType::IfTunnelGre4
                | InterfaceType::IfTunnelGre6 => {
                    Err(error::NetworkManager::Config(error::Config::NotSupported {
                        msg: format!(
                            "Unsupported default interface type: {:?}",
                            default_interface.config.interface_type
                        ),
                    }))
                }
            },
            None => Err(error::NetworkManager::Config(error::Config::NotFound {
                msg: format!(
                    "Trying to configure {} as a default interface but none was provided",
                    topological_path
                ),
            })),
        }
    }
/// Configures this device according the defaults provided in `default_interface`.
Configures this device according the defaults provided in `default_interface`.
Configures this device according the defaults provided in ` default_interface ` .
async fn configure_default_interface(
        &mut self,
        pid: PortId,
        topological_path: &str,
    ) -> error::Result<()> {
        match self.config.default_interface() {
            Some(default_interface) => match default_interface.config.interface_type {
                config::InterfaceType::IfUplink => self.configure_wan(pid, topological_path).await,
                config::InterfaceType::IfEthernet => {
                    self.configure_lan(&[pid], topological_path).await
                }
                InterfaceType::IfAggregate
                | InterfaceType::IfLoopback
                | InterfaceType::IfRoutedVlan
                | InterfaceType::IfSonet
                | InterfaceType::IfTunnelGre4
                | InterfaceType::IfTunnelGre6 => {
                    Err(error::NetworkManager::Config(error::Config::NotSupported {
                        msg: format!(
                            "Unsupported default interface type: {:?}",
                            default_interface.config.interface_type
                        ),
                    }))
                }
            },
            None => Err(error::NetworkManager::Config(error::Config::NotFound {
                msg: format!(
                    "Trying to configure {} as a default interface but none was provided",
                    topological_path
                ),
            })),
        }
    }
async fn configure_default_interface ( & mut self , pid : PortId , topological_path : & str , ) -> error :: Result < ( ) > { match self . config . default_interface ( ) { Some ( default_interface ) => match default_interface . config . interface_type { config :: InterfaceType :: IfUplink => self . configure_wan ( pid , topological_path ) . await , config :: InterfaceType :: IfEthernet => { self . configure_lan ( & [ pid ] , topological_path ) . await } InterfaceType :: IfAggregate | InterfaceType :: IfLoopback | InterfaceType :: IfRoutedVlan | InterfaceType :: IfSonet | InterfaceType :: IfTunnelGre4 | InterfaceType :: IfTunnelGre6 => { Err ( error :: NetworkManager :: Config ( error :: Config :: NotSupported { msg : format ! ( " " default_interface config interface_type ) , } ) ) } } , None => Err ( error :: NetworkManager :: Config ( error :: Config :: NotFound { msg : format ! ( " " topological_path ) , } ) ) , } }
Configures this device according the defaults provided in `default_interface`.
Configures this device according the defaults provided in ` default_interface ` .
&mut self
pid
PortId
topological_path
&str
&mut self
pid
PortId
topological_path
&str