Trait cargo::core::source::Source [] [src]

pub trait Source: Registry {
    fn source_id(&self) -> &SourceId;
fn update(&mut self) -> CargoResult<()>;
fn download(&mut self, package: &PackageId) -> CargoResult<Package>;
fn fingerprint(&self, pkg: &Package) -> CargoResult<String>; fn verify(&self, _pkg: &PackageId) -> CargoResult<()> { ... } }

A Source finds and downloads remote packages based on names and versions.

Required Methods

Returns the SourceId corresponding to this source

The update method performs any network operations required to get the entire list of all names, versions and dependencies of packages managed by the Source.

The download method fetches the full package for each name and version specified.

Generates a unique string which represents the fingerprint of the current state of the source.

This fingerprint is used to determine the "fresheness" of the source later on. It must be guaranteed that the fingerprint of a source is constant if and only if the output product will remain constant.

The pkg argument is the package which this fingerprint should only be interested in for when this source may contain multiple packages.

Provided Methods

If this source supports it, verifies the source of the package specified.

Note that the source may also have performed other checksum-based verification during the download step, but this is intended to be run just before a crate is compiled so it may perform more expensive checks which may not be cacheable.

Implementations on Foreign Types

impl<'a, T: Source + ?Sized + 'a> Source for Box<T>
[src]

[src]

Forwards to Source::source_id

[src]

Forwards to Source::update

[src]

Forwards to Source::download

[src]

Forwards to Source::fingerprint

[src]

Forwards to Source::verify

Implementors