cargo::core::profiles

Struct Profiles

Source
pub struct Profiles {
    incremental: Option<bool>,
    dir_names: HashMap<InternedString, InternedString>,
    by_name: HashMap<InternedString, ProfileMaker>,
    original_profiles: BTreeMap<InternedString, TomlProfile>,
    requested_profile: InternedString,
    rustc_host: InternedString,
}
Expand description

Collection of all profiles.

To get a specific Profile, you usually create this and call get_profile then.

Fields§

§incremental: Option<bool>

Incremental compilation can be overridden globally via:

  • CARGO_INCREMENTAL environment variable.
  • build.incremental config value.
§dir_names: HashMap<InternedString, InternedString>

Map of profile name to directory name for that profile.

§by_name: HashMap<InternedString, ProfileMaker>

The profile makers. Key is the profile name.

§original_profiles: BTreeMap<InternedString, TomlProfile>

The original profiles written by the user in the manifest and config.

This is here to assist with error reporting, as the ProfileMaker values have the inherits chains all merged together.

§requested_profile: InternedString

The profile the user requested to use.

§rustc_host: InternedString

The host target for rustc being used by this Profiles.

Implementations§

Source§

impl Profiles

Source

pub fn new( ws: &Workspace<'_>, requested_profile: InternedString, ) -> CargoResult<Profiles>

Source

fn predefined_dir_names() -> HashMap<InternedString, InternedString>

Returns the hard-coded directory names for built-in profiles.

Source

fn add_root_profiles( profile_makers: &mut Profiles, profiles: &BTreeMap<InternedString, TomlProfile>, trim_paths_enabled: bool, )

Initialize by_name with the two “root” profiles, dev, and release given the user’s definition.

Source

fn predefined_profiles() -> Vec<(&'static str, TomlProfile)>

Returns the built-in profiles (not including dev/release, which are “root” profiles).

Source

fn add_maker( &mut self, name: InternedString, profile: &TomlProfile, profiles: &BTreeMap<InternedString, TomlProfile>, ) -> CargoResult<()>

Creates a ProfileMaker, and inserts it into self.by_name.

Source

fn process_chain( &mut self, name: InternedString, profile: &TomlProfile, set: &mut HashSet<InternedString>, profiles: &BTreeMap<InternedString, TomlProfile>, ) -> CargoResult<ProfileMaker>

Build a ProfileMaker by recursively following the inherits setting.

  • name: The name of the profile being processed.
  • profile: The TOML profile being processed.
  • set: Set of profiles that have been visited, used to detect cycles.
  • profiles: Map of all TOML profiles.

Returns a ProfileMaker to be used for the given named profile.

Source

pub fn get_profile( &self, pkg_id: PackageId, is_member: bool, is_local: bool, unit_for: UnitFor, kind: CompileKind, ) -> Profile

Retrieves the profile for a target. is_member is whether or not this package is a member of the workspace.

Source

pub fn get_profile_run_custom_build( &self, for_unit_profile: &Profile, ) -> Profile

The profile for running a build.rs script is only used for setting a few environment variables. To ensure proper de-duplication of the running Unit, this uses a stripped-down profile (so that unrelated profile flags don’t cause build.rs to needlessly run multiple times).

Source

pub fn base_profile(&self) -> Profile

This returns the base profile. This is currently used for the [Finished] line. It is not entirely accurate, since it doesn’t select for the package that was actually built.

Source

pub fn get_dir_name(&self) -> InternedString

Gets the directory name for a profile, like debug or release.

Source

pub fn validate_packages( &self, profiles: Option<&TomlProfiles>, shell: &mut Shell, resolve: &Resolve, ) -> CargoResult<()>

Used to check for overrides for non-existing packages.

Source

fn get_profile_maker(&self, name: &str) -> CargoResult<&ProfileMaker>

Returns the profile maker for the given profile name.

Trait Implementations§

Source§

impl Clone for Profiles

Source§

fn clone(&self) -> Profiles

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Profiles

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where 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.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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 T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more

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: 160 bytes