Trait VersionFetcher

Source
pub trait VersionFetcher: Send + Sync {
    // Required methods
    fn tool_name(&self) -> &str;
    fn fetch_versions<'life0, 'async_trait>(
        &'life0 self,
        include_prerelease: bool,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<VersionInfo>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn get_latest_version<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<VersionInfo>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn get_latest_version_including_prerelease<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<VersionInfo>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn version_exists<'life0, 'life1, 'async_trait>(
        &'life0 self,
        version: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Trait for fetching version information from external sources

Required Methods§

Source

fn tool_name(&self) -> &str

Get the name of the tool this fetcher supports

Source

fn fetch_versions<'life0, 'async_trait>( &'life0 self, include_prerelease: bool, ) -> Pin<Box<dyn Future<Output = Result<Vec<VersionInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch available versions for the tool

Provided Methods§

Source

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

Get the latest stable version

Source

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

Get the latest version (including prereleases)

Source

fn version_exists<'life0, 'life1, 'async_trait>( &'life0 self, version: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if a specific version exists

Implementors§