fetch_pkgbuild_fast

Function fetch_pkgbuild_fast 

Source
pub async fn fetch_pkgbuild_fast(
    item: &PackageItem,
) -> Result<String, Box<dyn Error + Send + Sync>>
Expand description

What: Fetch PKGBUILD content for a package from AUR or official Git packaging repos.

Inputs:

  • item: Package whose PKGBUILD should be retrieved.

Output:

  • Ok(String) with PKGBUILD text when available; Err on network or lookup failure.

§Errors

  • Returns Err when network request fails (curl execution error)
  • Returns Err when PKGBUILD cannot be fetched from AUR or official GitLab repositories
  • Returns Err when rate limiting mutex is poisoned
  • Returns Err when task spawn fails

§Panics

  • Panics if the rate limiting mutex is poisoned

Details:

  • First tries offline methods (yay/paru cache) for fast loading.
  • Then tries network with rate limiting and timeout (10s).
  • Uses curl with timeout to prevent hanging on slow servers.