Skip to main content

spawn_index_refresh

Function spawn_index_refresh 

Source
pub fn spawn_index_refresh<F>(refresh: F) -> IndexRefreshHandle
where F: Future<Output = Result<OfficialIndex>> + Send + 'static,
Expand description

What: Start a caller-supplied async index refresh in the background.

Inputs:

  • refresh: Sendable 'static future returning a refreshed index or a structured error.

Output:

Details:

  • The API intentionally accepts a future rather than hiding pacman or network policy. Callers can use a local fetch, a caller-client HTTP fetcher, or an in-memory fixture with the same cancellation contract.
  • Dropping the handle detaches the task; call IndexRefreshHandle::cancel when a caller no longer wants the refresh to continue.