fetch_first_match_for_query

Function fetch_first_match_for_query 

Source
pub async fn fetch_first_match_for_query(q: String) -> Option<PackageItem>
Expand description

What: Resolve a free-form query string to a best-effort matching package.

Inputs:

  • q: Query string to resolve

Output:

  • Some(PackageItem) per the priority rules below; None if nothing usable is found.

Details (selection priority):

  1. Exact-name match from the official index;
  2. Exact-name match from AUR;
  3. First official result;
  4. Otherwise, first AUR result.

Performs network I/O for AUR; tolerates errors.