Struct cargo::core::package::PackageSet
source · pub struct PackageSet<'gctx> { /* private fields */ }Expand description
A set of packages, with the intent to download.
This is primarily used to convert a set of PackageIds to Packages. It
will download as needed, or used the cached download if available.
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.
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
Mutably borrows from an owned value. Read more