Struct cargo::core::registry::PackageRegistry
[−]
[src]
pub struct PackageRegistry<'cfg> { // some fields omitted }
This structure represents a registry of known packages. It internally
contains a number of Box<Source>
instances which are used to load a
Package
from.
The resolution phase of Cargo uses this to drive knowledge about new packages as well as querying for lists of new packages. It is here that sources are updated (e.g. network operations) and overrides are handled.
The general idea behind this registry is that it is centered around the
SourceMap
structure, contained within which is a mapping of a SourceId
to
a Source
. Each Source
in the map has been updated (using network
operations if necessary) and is ready to be queried for packages.
Methods
impl<'cfg> PackageRegistry<'cfg>
[src]
fn new(config: &'cfg Config) -> PackageRegistry<'cfg>
fn get(self, package_ids: &[PackageId]) -> PackageSet<'cfg>
fn add_sources(&mut self, ids: &[SourceId]) -> CargoResult<()>
fn add_preloaded(&mut self, id: &SourceId, source: Box<Source + 'cfg>)
fn add_override(&mut self, id: &SourceId, source: Box<Source + 'cfg>)
fn register_lock(&mut self, id: PackageId, deps: Vec<PackageId>)
Trait Implementations
impl<'cfg> Registry for PackageRegistry<'cfg>
[src]
fn query(&mut self, dep: &Dependency) -> CargoResult<Vec<Summary>>
Attempt to find the packages that match a dependency request.