pub struct BuildConfig {
pub requested_target: Option<String>,
pub jobs: u32,
pub release: bool,
pub mode: CompileMode,
pub message_format: MessageFormat,
pub force_rebuild: bool,
pub build_plan: bool,
pub cargo_as_rustc_wrapper: bool,
pub extra_rustc_env: Vec<(String, String)>,
pub extra_rustc_args: Vec<String>,
pub rustfix_diagnostic_server: RefCell<Option<RustfixDiagnosticServer>>,
}Expand description
Configuration information for a rustc build.
Fields§
§requested_target: Option<String>The target arch triple, defaults to host arch
jobs: u32How many rustc jobs to run in parallel
release: boolWhether we are building for release
mode: CompileModeIn what mode we are compiling
message_format: MessageFormatWhether to print std output 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.
cargo_as_rustc_wrapper: boolUse Cargo itself as the wrapper around rustc, only used for cargo fix
extra_rustc_env: Vec<(String, String)>Extra env vars to inject into rustc commands
extra_rustc_args: Vec<String>Extra args to inject into rustc commands
rustfix_diagnostic_server: RefCell<Option<RustfixDiagnosticServer>>Implementations§
Source§impl BuildConfig
impl BuildConfig
Sourcepub fn new(
config: &Config,
jobs: Option<u32>,
requested_target: &Option<String>,
mode: CompileMode,
) -> CargoResult<BuildConfig>
pub fn new( config: &Config, jobs: Option<u32>, requested_target: &Option<String>, mode: CompileMode, ) -> CargoResult<BuildConfig>
Parse all config files to learn about build configuration. Currently configured options are:
- build.jobs
- build.target
- target.$target.ar
- target.$target.linker
- target.$target.libfoo.metadata
pub fn json_messages(&self) -> bool
pub fn test(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for BuildConfig
impl !RefUnwindSafe for BuildConfig
impl !Sync for BuildConfig
impl Send for BuildConfig
impl Unpin for BuildConfig
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more