You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: problem_crawler.rs
    path of file: ./repos/AtCoderProblems/atcoder-problems-backend/src/crawler
    
    the code of the file until where you have to start completion: use crate::crawler::AtCoderFetcher;
use actix_web::rt::time;
use anyhow::Result;
use atcoder_client::ContestTypeSpecifier;
use sql_client::contest_problem::Conte
    
    pub async fn crawl(&self) -> Result<()> {
        log::info!("Starting...");
        let mut contests = Vec::new();

        match self
            .fetcher
            .fetch_contests(ContestTypeSpecifier::Permanent)
            .await
        {
            Ok(c) => {
                contests.extend(c);
            }
            Err(e) => {
                log::error!("{:?}", e);
            }
        }
        time::sleep(Duration::from_millis(500)).await;

        match self
            .fetcher
            .fetch_contests(ContestTypeSpecifier::Hidden)
            .await
        {
            Ok(c) => {
                contests.extend(c);
            }
            Err(e) => {
                log::error!("{:?}", e);
            }
        }

        for page in 1.. {
            match self
                .fetcher
                .fetch_contests(ContestTypeSpecifier::Normal { page })
                .await
            {
                Ok(c) => {
                    if c.is_empty() {
                        break;
                    }
                    contests.extend(c);
                }
                Err(e) => {
                    log::error!("{:?}", e);
                    break;
                }
            }
            time::sleep(Duration::from_millis(500)).await;
        }

        log::info!("There are {} contests.", contests.len());
        self.db.insert_contests(&contests).await?;

        let contests = self.db.load_contests().await?;
        let problems = self.db.load_problems().await?;
        let contest_problem = self.db.load_contest_problem().await?;

        let no_problem_contests =
            extract_no_problem_contests(&contests, &problems, &contest_problem);

        for contest in no_problem_contests {
            log::info!("Crawling problems of {}...", contest.id);
            match self.fetcher.fetch_problems(&contest.id).await {
                Ok((problems, contest_problem)) => {
                    self.db.insert_problems(&problems).await?;
                    self.db.insert_contest_problem(&contest_problem).await?;
                }
                Err(e) => {
                    log::error!("{:?}", e);
                }
            }
            time::sleep(Duration::from_millis(500)).await;
        }

        Ok(())
    }