Skip to main content

fetch_arch_package_detail

Function fetch_arch_package_detail 

Source
pub async fn fetch_arch_package_detail(
    client: &Client,
    package: &OfficialPackage,
    limits: MetadataFetchLimits,
) -> Result<Option<OfficialPackage>>
Expand description

What: Fetch one official Arch package detail with caller-owned transport policy.

Inputs:

  • client: Caller-provided reqwest client controlling timeout, proxy, TLS, redirect, and user-agent behavior.
  • package: Existing public index model selecting a package name and, optionally, repository and architecture.
  • limits: Explicit response and candidate bounds for this request.

Output:

  • An enriched OfficialPackage when the endpoint has an exact matching row, or None when no exact package row is present.

Details:

  • Uses ARCH_PACKAGE_SEARCH_URL, which is already the repository’s official-index fallback endpoint. For deterministic tests, derivative distributions, or another trusted endpoint, use fetch_official_package_detail_from.
  • It performs one bounded HTTP request and never invokes pacman or a shell.

§Errors

Returns an error for invalid selector/limits, transport/status/read failures, oversized responses, or malformed JSON response roots.