Struct cargo::core::package::PackageSet

source ·
pub struct PackageSet<'cfg> { /* 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<'cfg> PackageSet<'cfg>

source

pub fn new( package_ids: &[PackageId], sources: SourceMap<'cfg>, config: &'cfg Config ) -> CargoResult<PackageSet<'cfg>>

source

pub fn package_ids(&self) -> impl Iterator<Item = PackageId> + '_

source

pub fn packages(&self) -> impl Iterator<Item = &Package>

source

pub fn enable_download<'a>(&'a self) -> CargoResult<Downloads<'a, 'cfg>>

source

pub fn get_one(&self, id: PackageId) -> CargoResult<&Package>

source

pub fn get_many( &self, ids: impl IntoIterator<Item = PackageId> ) -> CargoResult<Vec<&Package>>

source

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.

source

pub fn sources(&self) -> Ref<'_, SourceMap<'cfg>>

source

pub fn sources_mut(&self) -> RefMut<'_, SourceMap<'cfg>>

source

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V