Struct cargo::core::profiles::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§

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

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

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

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

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.

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

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).

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.

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

Used to check for overrides for non-existing packages.

Returns the profile maker for the given profile name.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

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