Struct cargo::core::package::PackageSet
source · pub struct PackageSet<'cfg> {
packages: HashMap<PackageId, LazyCell<Package>>,
sources: RefCell<SourceMap<'cfg>>,
config: &'cfg Config,
multi: Multi,
downloading: Cell<bool>,
multiplexing: bool,
}
Expand description
A set of packages, with the intent to download.
This is primarily used to convert a set of PackageId
s to Package
s. It
will download as needed, or used the cached download if available.
Fields§
§packages: HashMap<PackageId, LazyCell<Package>>
§sources: RefCell<SourceMap<'cfg>>
§config: &'cfg Config
§multi: Multi
§downloading: Cell<bool>
Used to prevent reusing the PackageSet to download twice.
multiplexing: bool
Whether or not to use curl HTTP/2 multiplexing.
Implementations§
source§impl<'cfg> PackageSet<'cfg>
impl<'cfg> PackageSet<'cfg>
pub fn new( package_ids: &[PackageId], sources: SourceMap<'cfg>, config: &'cfg Config ) -> CargoResult<PackageSet<'cfg>>
pub fn package_ids(&self) -> impl Iterator<Item = PackageId> + '_
pub fn packages(&self) -> impl Iterator<Item = &Package>
pub fn enable_download<'a>(&'a self) -> CargoResult<Downloads<'a, 'cfg>>
pub fn get_one(&self, id: PackageId) -> CargoResult<&Package>
pub fn get_many( &self, ids: impl IntoIterator<Item = PackageId> ) -> CargoResult<Vec<&Package>>
sourcepub fn download_accessible(
&self,
resolve: &Resolve,
root_ids: &[PackageId],
has_dev_units: HasDevUnits,
requested_kinds: &[CompileKind],
target_data: &RustcTargetData<'cfg>,
force_all_targets: ForceAllTargets
) -> CargoResult<()>
pub fn download_accessible( &self, resolve: &Resolve, root_ids: &[PackageId], has_dev_units: HasDevUnits, requested_kinds: &[CompileKind], target_data: &RustcTargetData<'cfg>, force_all_targets: ForceAllTargets ) -> CargoResult<()>
Downloads any packages accessible from the give root ids.
sourcepub(crate) fn warn_no_lib_packages_and_artifact_libs_overlapping_deps(
&self,
ws: &Workspace<'cfg>,
resolve: &Resolve,
root_ids: &[PackageId],
has_dev_units: HasDevUnits,
requested_kinds: &[CompileKind],
target_data: &RustcTargetData<'_>,
force_all_targets: ForceAllTargets
) -> CargoResult<()>
pub(crate) fn warn_no_lib_packages_and_artifact_libs_overlapping_deps( &self, ws: &Workspace<'cfg>, resolve: &Resolve, root_ids: &[PackageId], has_dev_units: HasDevUnits, requested_kinds: &[CompileKind], target_data: &RustcTargetData<'_>, force_all_targets: ForceAllTargets ) -> CargoResult<()>
Check if there are any dependency packages that violate artifact constraints to instantly abort, or that do not have any libs which results in warnings.
fn filter_deps<'a>( pkg_id: PackageId, resolve: &'a Resolve, has_dev_units: HasDevUnits, requested_kinds: &'a [CompileKind], target_data: &'a RustcTargetData<'_>, force_all_targets: ForceAllTargets ) -> impl Iterator<Item = (PackageId, &'a HashSet<Dependency>)> + 'a
pub fn sources(&self) -> Ref<'_, SourceMap<'cfg>>
pub fn sources_mut(&self) -> RefMut<'_, SourceMap<'cfg>>
sourcepub fn add_set(&mut self, set: PackageSet<'cfg>)
pub fn add_set(&mut self, set: PackageSet<'cfg>)
Merge the given set into self.
Auto Trait Implementations§
impl<'cfg> !RefUnwindSafe for PackageSet<'cfg>
impl<'cfg> !Send for PackageSet<'cfg>
impl<'cfg> !Sync for PackageSet<'cfg>
impl<'cfg> Unpin for PackageSet<'cfg>
impl<'cfg> !UnwindSafe for PackageSet<'cfg>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 136 bytes