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 PackageId
s to Package
s. 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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more