pub struct BuildConfig {Show 17 fields
pub requested_kinds: Vec<CompileKind>,
pub jobs: u32,
pub keep_going: bool,
pub requested_profile: InternedString,
pub intent: UserIntent,
pub message_format: MessageFormat,
pub force_rebuild: bool,
pub build_plan: bool,
pub unit_graph: bool,
pub dry_run: bool,
pub primary_unit_rustc: Option<ProcessBuilder>,
pub rustfix_diagnostic_server: Rc<RefCell<Option<RustfixDiagnosticServer>>>,
pub export_dir: Option<PathBuf>,
pub future_incompat_report: bool,
pub timing_outputs: Vec<TimingOutput>,
pub sbom: bool,
pub compile_time_deps_only: bool,
}Expand description
Configuration information for a rustc build.
Fields§
§requested_kinds: Vec<CompileKind>The requested kind of compilation for this session
jobs: u32Number of rustc jobs to run in parallel.
keep_going: boolDo not abort the build as soon as there is an error.
requested_profile: InternedStringBuild profile
intent: UserIntentThe intent we are compiling in.
message_format: MessageFormattrue to print stdout in JSON format (for machine reading).
force_rebuild: boolForce Cargo to do a full rebuild and treat each target as changed.
build_plan: boolOutput a build plan to stdout instead of actually compiling.
unit_graph: boolOutput the unit graph to stdout instead of actually compiling.
dry_run: booltrue to avoid really compiling.
primary_unit_rustc: Option<ProcessBuilder>An optional override of the rustc process for primary units
rustfix_diagnostic_server: Rc<RefCell<Option<RustfixDiagnosticServer>>>A thread used by cargo fix to receive messages on a socket regarding
the success/failure of applying fixes.
export_dir: Option<PathBuf>The directory to copy final artifacts to. Note that even if
artifact-dir is set, a copy of artifacts still can be found at
target/(debug\release) as usual.
Named export_dir to avoid confusion with
CompilationFiles::artifact_dir.
future_incompat_report: booltrue to output a future incompatibility report at the end of the build
timing_outputs: Vec<TimingOutput>Which kinds of build timings to output (empty if none).
sbom: boolOutput SBOM precursor files.
compile_time_deps_only: boolBuild compile time dependencies only, e.g., build scripts and proc macros
Implementations§
Source§impl BuildConfig
impl BuildConfig
Sourcepub fn new(
gctx: &GlobalContext,
jobs: Option<JobsConfig>,
keep_going: bool,
requested_targets: &[String],
intent: UserIntent,
) -> CargoResult<BuildConfig>
pub fn new( gctx: &GlobalContext, jobs: Option<JobsConfig>, keep_going: bool, requested_targets: &[String], intent: UserIntent, ) -> CargoResult<BuildConfig>
Parses all config files to learn about build configuration. Currently configured options are:
build.jobsbuild.targettarget.$target.artarget.$target.linkertarget.$target.libfoo.metadata
Sourcepub fn emit_json(&self) -> bool
pub fn emit_json(&self) -> bool
Whether or not the user wants JSON output. Whether or not rustc
actually uses JSON is decided in add_error_format.
pub fn single_requested_kind(&self) -> CargoResult<CompileKind>
Trait Implementations§
Source§impl Clone for BuildConfig
impl Clone for BuildConfig
Source§fn clone(&self) -> BuildConfig
fn clone(&self) -> BuildConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for BuildConfig
impl !RefUnwindSafe for BuildConfig
impl !Send for BuildConfig
impl !Sync for BuildConfig
impl Unpin for BuildConfig
impl !UnwindSafe for BuildConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§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>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
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: 280 bytes