Trait PackageSourceProvider

Source
pub trait PackageSourceProvider:
    Sync
    + Send
    + Clone {
    // Required methods
    fn update(&self) -> Result<()>;
    fn query(&self, package_req: &PackageReq) -> Result<Vec<Manifest>>;
    fn download_package(
        &self,
        package_id: &PackageId,
    ) -> Result<PackageContents>;
    fn fallback_sources(&self) -> Result<Vec<PackageSourceId>>;
}

Required Methods§

Source

fn update(&self) -> Result<()>

Update this package source, if it has state that needs to be updated.

Source

fn query(&self, package_req: &PackageReq) -> Result<Vec<Manifest>>

Query this package source for all of the packages that match this PackageReq.

Source

fn download_package(&self, package_id: &PackageId) -> Result<PackageContents>

Downloads the contents of a package given its fully-qualified PackageId.

Source

fn fallback_sources(&self) -> Result<Vec<PackageSourceId>>

Provide a list of fallback sources to search if this source can’t provide a package

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§