Enum dinghy_lib::compiler::CompileMode
source · pub enum CompileMode {
Test,
Build,
Check {
test: bool,
},
Bench,
Doc {
deps: bool,
},
Doctest,
RunCustomBuild,
}
Expand description
The general “mode” of 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
Fields
test: bool
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
Target
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
Fields
deps: bool
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
sourceimpl CompileMode
impl CompileMode
sourcepub fn is_doc(self) -> bool
pub fn is_doc(self) -> bool
Returns true if this is a doc or doctest. Be careful using this. Although both run rustdoc, the dependencies for those two modes are very different.
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, doctest, or check-test).
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
sourceimpl Clone for CompileMode
impl Clone for CompileMode
sourcefn clone(&self) -> CompileMode
fn clone(&self) -> CompileMode
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more