/// Stage a config, downloading any packages and performing any stage-blocking
/// checks.
Stage a config, downloading any packages and performing any stage-blocking
checks.
Stage a config downloading any packages and performing any stage - blocking checks .
pub async fn stage<C>(log: Logger, conf: C) -> anyhow::Result<Token<C, state::Thrift>>
where
    C: StagableConfig,
{
    let downloader = HttpsDownloader::new().context("while constructing HTTPS downloader")?;
    try_join_all(conf.packages().into_iter().map(|package| {
        let log = log.clone();
        let downloader = downloader.clone();
        async move {
            ensure_package_on_disk_ignoring_artifacts(log, &downloader, &package).await?;
            Ok::<_, package_download::Error>(())
        }
    }))
    .await
    .context("while downloading packages")?;
    conf.check_downloaded_artifacts()
        .context("stage-blocking checks failed")?;
    let token = conf.save().context("while save config to disk")?;
    token.stage().context("while staging config on disk")?;
    Ok(token)
}
pub async fn stage < C > ( log : Logger , conf : C ) -> anyhow :: Result < Token < C , state :: Thrift > > where C : StagableConfig , { let downloader = HttpsDownloader :: new ( ) . context ( " " ) ? ; try_join_all ( conf . packages ( ) . into_iter ( ) . map ( | package | { let log = log . clone ( ) ; let downloader = downloader . clone ( ) ; async move { ensure_package_on_disk_ignoring_artifacts ( log , & downloader , & package ) . await ? ; Ok :: < _ , package_download :: Error > ( ( ) ) } } ) ) . await . context ( " " ) ? ; conf . check_downloaded_artifacts ( ) . context ( " " ) ? ; let token = conf . save ( ) . context ( " " ) ? ; token . stage ( ) . context ( " " ) ? ; Ok ( token ) }
Stage a config, downloading any packages and performing any stage-blocking
checks.
Stage a config downloading any packages and performing any stage - blocking checks .
log
Logger
conf
C