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§
Sourcefn update(&self) -> Result<()>
fn update(&self) -> Result<()>
Update this package source, if it has state that needs to be updated.
Sourcefn query(&self, package_req: &PackageReq) -> Result<Vec<Manifest>>
fn query(&self, package_req: &PackageReq) -> Result<Vec<Manifest>>
Query this package source for all of the packages that match this
PackageReq
.
Sourcefn download_package(&self, package_id: &PackageId) -> Result<PackageContents>
fn download_package(&self, package_id: &PackageId) -> Result<PackageContents>
Downloads the contents of a package given its fully-qualified
PackageId
.
Sourcefn fallback_sources(&self) -> Result<Vec<PackageSourceId>>
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.