async fn resolve<'a, A>(
    rewrites: &'a Arc<RwLock<RewriteManager>>,
    repo_manager: &'a Arc<RwLock<RepositoryManager<A>>>,
    cache: &'a PackageCache,
    blob_fetcher: &'a BlobFetcher,
    pkg_url: String,
    selectors: Vec<String>,
    _update_policy: UpdatePolicy,
    dir_request: ServerEnd<DirectoryMarker>,
) -> Result<(), Status>
where
    A: AmberConnect,
{
    let url = PkgUrl::parse(&pkg_url).map_err(|err| handle_bad_package_url(err, &pkg_url))?;
    let url = rewrites.read().rewrite(url);

    // While the fuchsia-pkg:// spec allows resource paths, the package resolver should not be
    // given one.
    if url.resource().is_some() {
        fx_log_err!("package url should not contain a resource name: {}", url);
        return Err(Status::INVALID_ARGS);
    }

    // FIXME: need to implement selectors.
    if !selectors.is_empty() {
        fx_log_warn!("resolve does not support selectors yet");
    }

    let fut = repo_manager.read().get_package(&url, cache, blob_fetcher);
    let merkle = fut.await?;

    fx_log_info!(
        "resolved {} as {} with the selectors {:?} to {}",
        pkg_url,
        url,
        selectors,
        merkle
    );

    cache.open(merkle, &selectors, dir_request).await?;

    Ok(())
}
/// Resolve the package.
///
/// FIXME: at the moment, we are proxying to Amber to resolve a package name and variant to a
/// merkleroot. Because of this, we cant' implement the update policy, so we just ignore it.
Resolve the package.
FIXME: at the moment, we are proxying to Amber to resolve a package name and variant to a
merkleroot. Because of this, we cant' implement the update policy, so we just ignore it.
Resolve the package . FIXME : at the moment we are proxying to Amber to resolve a package name and variant to a merkleroot . Because of this we cant ' implement the update policy so we just ignore it .
async fn resolve<'a, A>(
    rewrites: &'a Arc<RwLock<RewriteManager>>,
    repo_manager: &'a Arc<RwLock<RepositoryManager<A>>>,
    cache: &'a PackageCache,
    blob_fetcher: &'a BlobFetcher,
    pkg_url: String,
    selectors: Vec<String>,
    _update_policy: UpdatePolicy,
    dir_request: ServerEnd<DirectoryMarker>,
) -> Result<(), Status>
where
    A: AmberConnect,
{
    let url = PkgUrl::parse(&pkg_url).map_err(|err| handle_bad_package_url(err, &pkg_url))?;
    let url = rewrites.read().rewrite(url);
    // While the fuchsia-pkg:// spec allows resource paths, the package resolver should not be
    // given one.
    if url.resource().is_some() {
        fx_log_err!("package url should not contain a resource name: {}", url);
        return Err(Status::INVALID_ARGS);
    }
    // FIXME: need to implement selectors.
    if !selectors.is_empty() {
        fx_log_warn!("resolve does not support selectors yet");
    }
    let fut = repo_manager.read().get_package(&url, cache, blob_fetcher);
    let merkle = fut.await?;
    fx_log_info!(
        "resolved {} as {} with the selectors {:?} to {}",
        pkg_url,
        url,
        selectors,
        merkle
    );
    cache.open(merkle, &selectors, dir_request).await?;
    Ok(())
}
async fn resolve < ' a , A > ( rewrites : & ' a Arc < RwLock < RewriteManager > > , repo_manager : & ' a Arc < RwLock < RepositoryManager < A > > > , cache : & ' a PackageCache , blob_fetcher : & ' a BlobFetcher , pkg_url : String , selectors : Vec < String > , _update_policy : UpdatePolicy , dir_request : ServerEnd < DirectoryMarker > , ) -> Result < ( ) , Status > where A : AmberConnect , { let url = PkgUrl :: parse ( & pkg_url ) . map_err ( | err | handle_bad_package_url ( err , & pkg_url ) ) ? ; let url = rewrites . read ( ) . rewrite ( url ) ; // While the fuchsia-pkg:// spec allows resource paths, the package resolver should not be // given one. if url . resource ( ) . is_some ( ) { fx_log_err ! ( " " url ) ; return Err ( Status :: INVALID_ARGS ) ; } // FIXME: need to implement selectors. if ! selectors . is_empty ( ) { fx_log_warn ! ( " " ) ; } let fut = repo_manager . read ( ) . get_package ( & url , cache , blob_fetcher ) ; let merkle = fut . await ? ; fx_log_info ! ( " " pkg_url url selectors merkle ) ; cache . open ( merkle , & selectors , dir_request ) . await ? ; Ok ( ( ) ) }
Resolve the package.
Resolve the package .
rewrites
&'a Arc<RwLock<RewriteManager>>
repo_manager
&'a Arc<RwLock<RepositoryManager<A>>>
cache
&'a PackageCache
blob_fetcher
&'a BlobFetcher
pkg_url
String
selectors
Vec<String>
_update_policy
UpdatePolicy
dir_request
ServerEnd<DirectoryMarker>