pub struct PackageSet<'gctx> {
packages: HashMap<PackageId, LazyCell<Package>>,
sources: RefCell<SourceMap<'gctx>>,
gctx: &'gctx GlobalContext,
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<'gctx>>
§gctx: &'gctx GlobalContext
§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<'gctx> PackageSet<'gctx>
impl<'gctx> PackageSet<'gctx>
pub fn new( package_ids: &[PackageId], sources: SourceMap<'gctx>, gctx: &'gctx GlobalContext, ) -> CargoResult<PackageSet<'gctx>>
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, 'gctx>>
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<'gctx>,
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<'gctx>, 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<'gctx>,
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<'gctx>, 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<'gctx>>
pub fn sources_mut(&self) -> RefMut<'_, SourceMap<'gctx>>
Sourcepub fn add_set(&mut self, set: PackageSet<'gctx>)
pub fn add_set(&mut self, set: PackageSet<'gctx>)
Merge the given set into self.
Auto Trait Implementations§
impl<'gctx> !Freeze for PackageSet<'gctx>
impl<'gctx> !RefUnwindSafe for PackageSet<'gctx>
impl<'gctx> !Send for PackageSet<'gctx>
impl<'gctx> !Sync for PackageSet<'gctx>
impl<'gctx> Unpin for PackageSet<'gctx>
impl<'gctx> !UnwindSafe for PackageSet<'gctx>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§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>,
§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