pub enum CompileMode {
Test,
Build,
Check {
test: bool,
},
Bench,
Doc {
deps: bool,
},
Doctest,
RunCustomBuild,
}Expand description
The general “mode” for what to do.
This is used for two purposes. The commands themselves pass this in to
compile_ws to tell it the general execution strategy. This influences
the default targets selected. The other use is in the Unit struct
to indicate what is being done with a specific target.
Variants§
Test
A target being built for a test.
Build
Building a target with rustc (lib or bin).
Check
Building a target with rustc to emit rmeta metadata only. If
test is true, then it is also compiled with --test to check it like
a test.
Bench
Used to indicate benchmarks should be built. This is not used in
Unit, because it is essentially the same as Test (indicating
--test should be passed to rustc) and by using Test instead it
allows some de-duping of Units to occur.
Doc
A target that will be documented with rustdoc.
If deps is true, then it will also document all dependencies.
Doctest
A target that will be tested with rustdoc.
RunCustomBuild
A marker for Units that represent the execution of a build.rs script.
Implementations§
Source§impl CompileMode
impl CompileMode
Sourcepub fn is_doc_test(self) -> bool
pub fn is_doc_test(self) -> bool
Returns true if this a doc test.
Sourcepub fn is_any_test(self) -> bool
pub fn is_any_test(self) -> bool
Returns true if this is any type of test (test, benchmark, doc test, or
check test).
Sourcepub fn is_rustc_test(self) -> bool
pub fn is_rustc_test(self) -> bool
Returns true if this is something that passes --test to rustc.
Sourcepub fn is_run_custom_build(self) -> bool
pub fn is_run_custom_build(self) -> bool
Returns true if this is the execution of a build.rs script.
Sourcepub fn all_modes() -> &'static [CompileMode]
pub fn all_modes() -> &'static [CompileMode]
List of all modes (currently used by cargo clean -p for computing
all possible outputs).
Trait Implementations§
Source§impl Clone for CompileMode
impl Clone for CompileMode
Source§fn clone(&self) -> CompileMode
fn clone(&self) -> CompileMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more