Source

Trait Source 

Source
pub trait Source: Sync + Debug {
    // Required method
    fn query<'life0, 'life1, 'async_trait>(
        &'life0 self,
        package: &'life1 PackageSource,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<PackageSummary>, QueryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn latest<'life0, 'life1, 'async_trait>(
        &'life0 self,
        pkg: &'life1 PackageSource,
    ) -> Pin<Box<dyn Future<Output = Result<PackageSummary, QueryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Something that packages can be downloaded from.

Required Methods§

Source

fn query<'life0, 'life1, 'async_trait>( &'life0 self, package: &'life1 PackageSource, ) -> Pin<Box<dyn Future<Output = Result<Vec<PackageSummary>, QueryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Ask this source which packages would satisfy a particular Dependency constraint.

§Assumptions

If this method returns a successful result, it is guaranteed that there will be at least one PackageSummary, otherwise implementations should return QueryError::NotFound or QueryError::NoMatches.

Provided Methods§

Source

fn latest<'life0, 'life1, 'async_trait>( &'life0 self, pkg: &'life1 PackageSource, ) -> Pin<Box<dyn Future<Output = Result<PackageSummary, QueryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Run Source::query() and get the PackageSummary for the latest version.

Implementors§