Skip to main content

DownloadCatalog

Trait DownloadCatalog 

Source
pub trait DownloadCatalog:
    Debug
    + Send
    + Sync {
    // Required method
    fn published<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<RunnerDownloads, PackageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Where the published runner-download metadata comes from.

Deliberately narrower than c3’s InventoryGateway: this module needs one answer, and a port with one method is a port a test can substitute without standing up a whole gateway. GatewayCatalog adapts the real one.

§Reporting a version rejection through this port

GitHub’s runner-downloads endpoint does not itself reject a version — the rejection lands at registration, which is e3’s path. This port carries PackageError::VersionRejected anyway so that a rejection observed anywhere in the agent reaches the one place that can act on it: the cache, whose fix is a newer package.

An implementation that answers VersionRejected is promising that retrying is pointless. PackageCache honours that literally — it makes no further attempt and spends none of its retry budget — so an implementation that returns it for a transient condition converts a blip into a stopped host. When in doubt, answer PackageError::CatalogUnavailable, which is retryable.

Required Methods§

Source

fn published<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<RunnerDownloads, PackageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The runner packages GitHub currently publishes.

§Errors

PackageError::CatalogUnavailable for anything a retry could clear, PackageError::VersionRejected for a version refusal.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§