/// 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(
    cache: &PackageCache,
    package_fetcher: &PackageFetcher,
    url: String,
    dir_request: ServerEnd<DirectoryMarker>,
) -> Result<(), Status> {
    trace::duration_begin!("app", "resolve", "url" => url.as_str());
    let pkg_url = match PkgUrl::parse(&url) {
        Ok(url) => url,
        Err(err) => {
            return Err(handle_bad_package_url(err, &url));
        }
    };
    let queued_fetch = package_fetcher.push(pkg_url.clone(), ());
    let merkle_or_status = queued_fetch.await.expect("expected queue to be open");
    trace::duration_end!("app", "resolve", "status" => merkle_or_status.err().unwrap_or(Status::OK).to_string().as_str());
    match merkle_or_status {
        Ok(merkle) => {
            let selectors = vec![];
            cache
                .open(merkle, &selectors, dir_request)
                .await
                .map_err(|err| handle_bad_package_open(err, &url))
        }
        Err(status) => Err(status),
    }
}
async fn resolve ( cache : & PackageCache , package_fetcher : & PackageFetcher , url : String , dir_request : ServerEnd < DirectoryMarker > , ) -> Result < ( ) , Status > { trace :: duration_begin ! ( " " " " " " url as_str ( ) ) ; let pkg_url = match PkgUrl :: parse ( & url ) { Ok ( url ) => url , Err ( err ) => { return Err ( handle_bad_package_url ( err , & url ) ) ; } } ; let queued_fetch = package_fetcher . push ( pkg_url . clone ( ) , ( ) ) ; let merkle_or_status = queued_fetch . await . expect ( " " ) ; trace :: duration_end ! ( " " " " " " merkle_or_status err ( ) unwrap_or ( Status OK ) to_string ( ) as_str ( ) ) ; match merkle_or_status { Ok ( merkle ) => { let selectors = vec ! [ ] ; cache . open ( merkle , & selectors , dir_request ) . await . map_err ( | err | handle_bad_package_open ( err , & url ) ) } Err ( status ) => Err ( status ) , } }
Resolve the package.
Resolve the package .
cache
&PackageCache
package_fetcher
&PackageFetcher
url
String
dir_request
ServerEnd<DirectoryMarker>