pub(crate) async fn fetch_remote_package(
    shared_client: Arc<HttpClient>,
    id: &str,
    flavor: &Flavor,
) -> Result<(String, TukuiPackage), DownloadError> {
    let url = api_endpoint(id, flavor);

    let timeout = Some(30);
    let mut resp = request_async(&shared_client, &url, vec![], timeout).await?;

    if resp.status().is_success() {
        let package = resp.json()?;
        Ok((id.to_string(), package))
    } else {
        Err(DownloadError::InvalidStatusCode {
            code: resp.status(),
            url,
        })
    }
}
/// Function to fetch a remote addon package which contains
/// information about the addon on the repository.
Function to fetch a remote addon package which contains
information about the addon on the repository.
Function to fetch a remote addon package which contains information about the addon on the repository .
pub(crate) async fn fetch_remote_package(
    shared_client: Arc<HttpClient>,
    id: &str,
    flavor: &Flavor,
) -> Result<(String, TukuiPackage), DownloadError> {
    let url = api_endpoint(id, flavor);
    let timeout = Some(30);
    let mut resp = request_async(&shared_client, &url, vec![], timeout).await?;
    if resp.status().is_success() {
        let package = resp.json()?;
        Ok((id.to_string(), package))
    } else {
        Err(DownloadError::InvalidStatusCode {
            code: resp.status(),
            url,
        })
    }
}
pub ( crate ) async fn fetch_remote_package ( shared_client : Arc < HttpClient > , id : & str , flavor : & Flavor , ) -> Result < ( String , TukuiPackage ) , DownloadError > { let url = api_endpoint ( id , flavor ) ; let timeout = Some ( 30 ) ; let mut resp = request_async ( & shared_client , & url , vec ! [ ] , timeout ) . await ? ; if resp . status ( ) . is_success ( ) { let package = resp . json ( ) ? ; Ok ( ( id . to_string ( ) , package ) ) } else { Err ( DownloadError :: InvalidStatusCode { code : resp . status ( ) , url , } ) } }
Function to fetch a remote addon package which contains
information about the addon on the repository.
Function to fetch a remote addon package which contains information about the addon on the repository .
shared_client
Arc<HttpClient>
id
&str
flavor
&Flavor
shared_client
Arc<HttpClient>
id
&str
flavor
&Flavor