pub async fn check_website(&self, uri: &Uri) -> Status {
        // Workaround for upstream reqwest panic
        if invalid(&uri.url) {
            if matches!(uri.scheme(), "http" | "https") {
                // This is a truly invalid URI with a known scheme.
                // If we pass that to reqwest it would panic.
                return Status::Error(ErrorKind::InvalidURI(uri.clone()));
            }
            // This is merely a URI with a scheme that is not supported by
            // reqwest yet. It would be safe to pass that to reqwest and it wouldn't
            // panic, but it's also unnecessary, because it would simply return an error.
            return Status::Unsupported(ErrorKind::InvalidURI(uri.clone()));
        }

        let mut retries: u64 = 0;
        let mut wait = self.retry_wait_time;

        let mut status = self.check_default(uri).await;
        while retries < self.max_retries {
            if status.is_success() {
                return status;
            }
            sleep(wait).await;
            retries += 1;
            wait *= 2;
            status = self.check_default(uri).await;
        }

        // Pull out the heavy machinery in case of a failed normal request.
        // This could be a GitHub URL and we ran into the rate limiter.
        if let Some(github_uri) = uri.gh_org_and_repo() {
            let status = self.check_github(github_uri).await;
            // Only return Github status in case of success
            // Otherwise return the original error, which has more information
            if status.is_success() {
                return status;
            }
        }

        status
    }
/// Checks the given URI of a website.
///
/// Unsupported schemes will be ignored
Checks the given URI of a website.
Unsupported schemes will be ignored
Checks the given URI of a website . Unsupported schemes will be ignored
pub async fn check_website(&self, uri: &Uri) -> Status {
        // Workaround for upstream reqwest panic
        if invalid(&uri.url) {
            if matches!(uri.scheme(), "http" | "https") {
                // This is a truly invalid URI with a known scheme.
                // If we pass that to reqwest it would panic.
                return Status::Error(ErrorKind::InvalidURI(uri.clone()));
            }
            // This is merely a URI with a scheme that is not supported by
            // reqwest yet. It would be safe to pass that to reqwest and it wouldn't
            // panic, but it's also unnecessary, because it would simply return an error.
            return Status::Unsupported(ErrorKind::InvalidURI(uri.clone()));
        }
        let mut retries: u64 = 0;
        let mut wait = self.retry_wait_time;
        let mut status = self.check_default(uri).await;
        while retries < self.max_retries {
            if status.is_success() {
                return status;
            }
            sleep(wait).await;
            retries += 1;
            wait *= 2;
            status = self.check_default(uri).await;
        }
        // Pull out the heavy machinery in case of a failed normal request.
        // This could be a GitHub URL and we ran into the rate limiter.
        if let Some(github_uri) = uri.gh_org_and_repo() {
            let status = self.check_github(github_uri).await;
            // Only return Github status in case of success
            // Otherwise return the original error, which has more information
            if status.is_success() {
                return status;
            }
        }
        status
    }
pub async fn check_website ( & self , uri : & Uri ) -> Status { // Workaround for upstream reqwest panic if invalid ( & uri . url ) { if matches ! ( uri scheme ( ) " " " " ) { // This is a truly invalid URI with a known scheme. // If we pass that to reqwest it would panic. return Status :: Error ( ErrorKind :: InvalidURI ( uri . clone ( ) ) ) ; } // This is merely a URI with a scheme that is not supported by // reqwest yet. It would be safe to pass that to reqwest and it wouldn't // panic, but it's also unnecessary, because it would simply return an error. return Status :: Unsupported ( ErrorKind :: InvalidURI ( uri . clone ( ) ) ) ; } let mut retries : u64 = 0 ; let mut wait = self . retry_wait_time ; let mut status = self . check_default ( uri ) . await ; while retries < self . max_retries { if status . is_success ( ) { return status ; } sleep ( wait ) . await ; retries += 1 ; wait *= 2 ; status = self . check_default ( uri ) . await ; } // Pull out the heavy machinery in case of a failed normal request. // This could be a GitHub URL and we ran into the rate limiter. if let Some ( github_uri ) = uri . gh_org_and_repo ( ) { let status = self . check_github ( github_uri ) . await ; // Only return Github status in case of success // Otherwise return the original error, which has more information if status . is_success ( ) { return status ; } } status }
Checks the given URI of a website.
Checks the given URI of a website .
&self
uri
&Uri