Skip to main content

Profile

Struct Profile 

Source
pub struct Profile {
Show 14 fields pub opt_level: Option<OptLevel>, pub debug: Option<DebugSetting>, pub split_debuginfo: Option<String>, pub rpath: Option<bool>, pub lto: Option<LtoSetting>, pub debug_assertions: Option<bool>, pub codegen_units: Option<u16>, pub panic: Option<String>, pub incremental: Option<bool>, pub overflow_checks: Option<bool>, pub strip: Option<StripSetting>, pub package: BTreeMap<String, Self>, pub build_override: Option<Box<Self>>, pub inherits: Option<String>,
}
Expand description

Compilation/optimization settings for a workspace

Fields§

§opt_level: Option<OptLevel>

The opt-level setting controls the -C opt-level flag which controls the level of optimization.

§debug: Option<DebugSetting>

The debug setting controls the -C debuginfo flag which controls the amount of debug information included in the compiled binary.

§split_debuginfo: Option<String>

The split-debuginfo setting controls the -C split-debuginfo flag which controls whether debug information, if generated, is either placed in the executable itself or adjacent to it.

§rpath: Option<bool>

The rpath setting controls the -C rpath flag which controls whether or not rpath is enabled.

§lto: Option<LtoSetting>

The lto setting controls rustc’s -C lto, -C linker-plugin-lto, and -C embed-bitcode options, which control LLVM’s link time optimizations.

LTO can produce better optimized code, using whole-program analysis, at the cost of longer linking time.

§debug_assertions: Option<bool>

The debug-assertions setting controls the -C debug-assertions flag which turns cfg(debug_assertions) conditional compilation on or off.

§codegen_units: Option<u16>

The codegen-units setting controls the -C codegen-units flag which controls how many “code generation units” a crate will be split into.

More code generation units allows more of a crate to be processed in parallel possibly reducing compile time, but may produce slower code.

§panic: Option<String>

The panic setting controls the -C panic flag which controls which panic strategy to use.

The valid options are:

  • unwind: Unwind the stack upon panic.
  • abort: Terminate the process upon panic.
§incremental: Option<bool>

The incremental setting controls the -C incremental flag which controls whether or not incremental compilation is enabled.

§overflow_checks: Option<bool>

The overflow-checks setting controls the -C overflow-checks flag which controls the behavior of runtime integer overflow.

§strip: Option<StripSetting>

The strip option controls the -C strip flag, which directs rustc to strip either symbols or debuginfo from a binary.

§package: BTreeMap<String, Self>

Profile settings can be overridden for specific packages and build-time crates.

To override the settings for a specific package, use the package table to change the settings for the named package:

# The `foo` package will use the -Copt-level=3 flag.
[profile.dev.package.foo]
opt-level = 3
§build_override: Option<Box<Self>>

To override the settings for build scripts, proc macros, and their dependencies, use the build-override table:

# Set the settings for build scripts and proc-macros.
[profile.dev.build-override]
opt-level = 3
§inherits: Option<String>

Specifies which profile the custom profile inherits settings from when the setting is not specified.

Trait Implementations§

Source§

impl Clone for Profile

Source§

fn clone(&self) -> Profile

Returns a duplicate 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 Profile

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Profile

Source§

fn default() -> Profile

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Profile

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Merge for Profile

Source§

fn merge(&mut self, other: Self)

Source§

impl PartialEq for Profile

Source§

fn eq(&self, other: &Profile) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Profile

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Profile

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 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.

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,