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
impl Profiles
pub fn new( ws: &Workspace<'_>, requested_profile: InternedString ) -> CargoResult<Profiles>
sourcefn predefined_dir_names() -> HashMap<InternedString, InternedString>
fn predefined_dir_names() -> HashMap<InternedString, InternedString>
Returns the hard-coded directory names for built-in profiles.
sourcefn add_root_profiles(
profile_makers: &mut Profiles,
profiles: &BTreeMap<InternedString, TomlProfile>
)
fn add_root_profiles( profile_makers: &mut Profiles, profiles: &BTreeMap<InternedString, TomlProfile> )
Initialize by_name
with the two “root” profiles, dev
, and
release
given the user’s definition.
sourcefn predefined_profiles() -> Vec<(&'static str, TomlProfile)>
fn predefined_profiles() -> Vec<(&'static str, TomlProfile)>
Returns the built-in profiles (not including dev/release, which are “root” profiles).
sourcefn add_maker(
&mut self,
name: InternedString,
profile: &TomlProfile,
profiles: &BTreeMap<InternedString, TomlProfile>
) -> CargoResult<()>
fn add_maker( &mut self, name: InternedString, profile: &TomlProfile, profiles: &BTreeMap<InternedString, TomlProfile> ) -> CargoResult<()>
Creates a ProfileMaker
, and inserts it into self.by_name
.
sourcefn process_chain(
&mut self,
name: InternedString,
profile: &TomlProfile,
set: &mut HashSet<InternedString>,
profiles: &BTreeMap<InternedString, TomlProfile>
) -> CargoResult<ProfileMaker>
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.
sourcepub fn get_profile(
&self,
pkg_id: PackageId,
is_member: bool,
is_local: bool,
unit_for: UnitFor,
kind: CompileKind
) -> Profile
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.
sourcepub fn get_profile_run_custom_build(
&self,
for_unit_profile: &Profile
) -> Profile
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).
sourcepub fn base_profile(&self) -> Profile
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.
sourcepub fn get_dir_name(&self) -> InternedString
pub fn get_dir_name(&self) -> InternedString
Gets the directory name for a profile, like debug
or release
.
sourcepub fn validate_packages(
&self,
profiles: Option<&TomlProfiles>,
shell: &mut Shell,
resolve: &Resolve
) -> CargoResult<()>
pub fn validate_packages( &self, profiles: Option<&TomlProfiles>, shell: &mut Shell, resolve: &Resolve ) -> CargoResult<()>
Used to check for overrides for non-existing packages.
sourcefn get_profile_maker(&self, name: InternedString) -> CargoResult<&ProfileMaker>
fn get_profile_maker(&self, name: InternedString) -> CargoResult<&ProfileMaker>
Returns the profile maker for the given profile name.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Profiles
impl Send for Profiles
impl Sync for Profiles
impl Unpin for Profiles
impl UnwindSafe for Profiles
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
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> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
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