Skip to main content

VersionSource

Trait VersionSource 

Source
pub trait VersionSource: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn fetch_latest<'life0, 'async_trait>(
        &'life0 self,
        options: FetchOptions,
    ) -> Pin<Box<dyn Future<Output = VersionSourceResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn fetch_versions<'life0, 'async_trait>(
        &'life0 self,
        _options: FetchVersionsOptions,
    ) -> Pin<Box<dyn Future<Output = Result<VersionListResult, UpdateKitError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Trait for version sources that can check for updates.

Required Methods§

Source

fn name(&self) -> &str

Returns the name of this source (e.g. “github”, “npm”).

Source

fn fetch_latest<'life0, 'async_trait>( &'life0 self, options: FetchOptions, ) -> Pin<Box<dyn Future<Output = VersionSourceResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch the latest version from this source.

Provided Methods§

Source

fn fetch_versions<'life0, 'async_trait>( &'life0 self, _options: FetchVersionsOptions, ) -> Pin<Box<dyn Future<Output = Result<VersionListResult, UpdateKitError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch a paginated list of versions. Not all sources support this.

Implementors§