pub async fn try_auto_connect(&self, timeout: std::time::Duration) -> Result<bool, CaptivePortalError> {
        self.enable_auto_connect().await;

        use connections::Settings;
        let p = nonblock::Proxy::new(NM_BUSNAME, NM_SETTINGS_PATH, self.conn.clone());

        debug!(
            "Trying to connect to one of {} known connections ...",
            p.connections().await?.len()
        );

        match self.wait_for_connectivity(false, timeout).await {
            Ok(state) => Ok(state == NetworkManagerState::Connected || state == NetworkManagerState::ConnectedLimited),
            Err(CaptivePortalError::NotRequiredConnectivity(_)) => Ok(false),
            Err(e) => Err(e),
        }
    }
/// Let network manager try to auto-connect.
Let network manager try to auto-connect.
Let network manager try to auto - connect .
pub async fn try_auto_connect(&self, timeout: std::time::Duration) -> Result<bool, CaptivePortalError> {
        self.enable_auto_connect().await;
        use connections::Settings;
        let p = nonblock::Proxy::new(NM_BUSNAME, NM_SETTINGS_PATH, self.conn.clone());
        debug!(
            "Trying to connect to one of {} known connections ...",
            p.connections().await?.len()
        );
        match self.wait_for_connectivity(false, timeout).await {
            Ok(state) => Ok(state == NetworkManagerState::Connected || state == NetworkManagerState::ConnectedLimited),
            Err(CaptivePortalError::NotRequiredConnectivity(_)) => Ok(false),
            Err(e) => Err(e),
        }
    }
pub async fn try_auto_connect ( & self , timeout : std :: time :: Duration ) -> Result < bool , CaptivePortalError > { self . enable_auto_connect ( ) . await ; use connections :: Settings ; let p = nonblock :: Proxy :: new ( NM_BUSNAME , NM_SETTINGS_PATH , self . conn . clone ( ) ) ; debug ! ( " " p connections ( ) await len ( ) ) ; match self . wait_for_connectivity ( false , timeout ) . await { Ok ( state ) => Ok ( state == NetworkManagerState :: Connected || state == NetworkManagerState :: ConnectedLimited ) , Err ( CaptivePortalError :: NotRequiredConnectivity ( _ ) ) => Ok ( false ) , Err ( e ) => Err ( e ) , } }
Let network manager try to auto-connect.
Let network manager try to auto - connect .
&self
timeout
std::time::Duration
&self
timeout
std::time::Duration